There is this idea among the NI community that people who hate labview only used it for a couple days or simply don't know what they are doing. If you look around the web for other blog posts hating on LabView, it's pretty evident that they have good experience with it. For example, none of these rants sound like knee-jerk reactions after 3 days:
Personally, I used LabView in gradschool for 5 years. When I started gradschool, I don't really know any programming languages. I had some prior experince with both Fortran and LabView from my undergrad days, but that was a good 8 years in the past. So that meant I was starting to learn Matlab and LabView (and later, c and python in my spare time) from pretty equal footing. I wasn't coming to LabView with years of prior text-only experience biasing my perception. After 5 years of daily work in matlab and LabView, I felt far more efficient in matlab, despite having taken official trainings (only) in LabView and despite having spent roughly equal time with both.
The common rebuttal you will hear from the LabView evangelists is that you can create spaghetti code in any language and that all of these complaints come from people who are using LabView "wrong". Aside from sounding suspicously like a No True Scottsman argument, the problem with this line of reasoning is that LabView makes it excessively difficult to follow good software practices. Part of this because there is so much boilerplate and ceremony involved, e.g., just to create a new function. The evangalists will also tell you that you need to "get more training". G is the only programming language I have seen yet where the users have become shills for one of their software vendors.
In much more detail, what follows are many of the reasons why I believe LabView sucks.
The compiler error messages suck. A typical error is shown in the following screenshot.
GCC telling me something is neither a struct nor union
is more informative. The spewing garbage gcc emits if I accidently put a brace after function forward delcaration is easy to figure out. But this? "B is A and C is A and that is not compatible." Where does one even start?
Generating an error message is exercise in frustration. First you, must register the error message in C:\Program Files/National Instruments/bowls of/god_forsaken.desert/
. Then you must restart LabView. Then you wire up an error handling VI with about 45 connectors just to print one error message. Compare this to matlab:
error('you gave me dumb input.')
c++ :
throw std::invalid_argument("you gave me dumb input.");
Python:
raise ValueError('you gave me dumb input.')
The IDE sucks. Because the language is closed and proprietary, you have you choice but to us the NI IDE. With text, if you don't like notepad, use emacs; if you don't like emacs use vim; if you don't that, use sublime; if none of those float your boart use VSCode. If you're still not happy, write your own. I dont even know where to start on how much the IDE sucks, so lets start randomly.
G
, you get to spend hours tidying up your wires manually.Labview doesn't have any concept of returning from a function early. I.e., in any sane programing language, you can do something like
function fun(a, last_err) if some_condtion{ return } # All the code in fun() is supposed to do.
Instead, you have to write the equivalent of
function fun(a, last_err) if some_condition # do nothing else #All the code fun() is supposed to do.
This is needless excessive verbosity. It doesn't look to bad here, but it is rediculous for more complex functions. It is the G equivalent of needing one extra level of indentation for every function because basically every function is wrapped in an error checking case structure.
Map
type, python as the eponymous dict
, c++ as std::map
or std::unordered_map
.x[-1]
.x[x==1]
.idx = [1,3,6,8]; z = x[idx];
getattr
, for example.LabView has shitty support for version control. This is due to a host of reasons:
Their "visual" diff and merge tools suck. These tools will not work to diff controls, classes or library files. Half the time the tool crashes. The tool very, very, often has no idea what has changed. Sometimes it will give you a list of things that might have changed.
The tool won't even work with the LabView project itself. This project file changes everytime a file is changed. This makes the tool all but worthless.
sub-vi-A
is called by sub-VIs B
, C
and D
, then B
, C
, and D
all have the path of sub-vi-A
hardcoded into them. Thus, if you change the location on disk of sub-vi-A
, that results in changes to sub-vis B
, C
, D
as well. This behavior is absolutely BATSHIT FUCKING CRAZY. Python, Matlab and c++ all handle this way better. This sucks for version control, but also really sucks for stealing a bunch of function from some other project: as soon as you move them, not only will you get a bunch errors and have to "resolve conflicts", but they will keep looking for each other in their previous location. If those files are open in another project, LabView cannot keep them straight.git mv
to rename a file. Rather, you are supposed to do this inside the project, which means that git has no knowledge that a file was simply moved. All it sees is that a file got deleted and another file got added. This completely breaks version control. The only work-around I have found is to first remove the file from your project, do git mv name_old name new, then add the file back to your project.