r/LabVIEW • • May 18 '18

LabVIEW in a nutshell

Post image
48 Upvotes

13 comments sorted by

7

u/hooovahh Champion May 18 '18

Yes, yes it is.

3

u/[deleted] May 18 '18

Looks ready to launch human rated rockets to me

2

u/jlittle988 Intermediate May 18 '18

Oh.. oh no...

2

u/brewzer May 19 '18

Shudder

2

u/[deleted] May 19 '18

Hahaha looks like my first program haha

1

u/siadajpan CLA May 19 '18

Where is the stop in this while loop?

4

u/YourRedditUserName May 19 '18

This bothered me enough to go find it...

Original (higher def) image is here: http://forums.ni.com/legacyfs/online/35148_BadLabVIEW.PNG

The 'stop' is actually a 'run while true' and is above the Terminal labeled "Stop" in the lower left hand corner.

1

u/siadajpan CLA May 19 '18

Ha:) found it, couldn't be placed any better!

0

u/[deleted] May 19 '18

[deleted]

20

u/kmoz CPI May 19 '18

The good thing about labview is that you can instantly recognize bad code. The bad thing about labview is that your bad code is instantly recognizable.

5

u/datenwolf May 19 '18

My main issue with LabVIEW is not the spaghetti code. What really bothers me (from a practical programming perspective) is, that it doesn't force you to name things. You can just pull (unnamed) wires around. Rinse and repeat and eventually you end up with a ratsnets that is very, very hard to understand, even if the overall layout and structure of the data flow is clean and tidy.

In text based programming the mere fact that you're more or less forced to name stuff already weeds out a lot of problematic behaviours.

2

u/[deleted] May 20 '18

[removed] — view removed comment

1

u/datenwolf May 20 '18 edited May 20 '18

The wires are the variables, right click the wire, show label, give the label a name. Now you're in control of the variable names if that helps.

I know. But who does that? The issue is, that labeling wires is completely optional. Properly naming things should be mandatory, though.

In text based programming you can easily globally scope a named variable and create a race condition in about 10 lines of code.

And in LabVIEW you create a local variable on a indicator or control. Same, same but different.

Engineering good software takes time and talent, no matter what language you've decided to write it in.

However some programming environments make it exponentially more difficult to do stupid things, than others. Furthermore LabVIEW requires one to jump through some seriously convoluted hackish hoops to implement things which are trivial to do in other languages.

Take malleable VIs for example. It took LabVIEW until version 2017 to get a feature that superficially resembles some aspects of type inference and some aspects of dynamic typing.

Speaking of type inference: Why is it, that to this date LabVIEW doesn't implement some form FRP on its dataflow, and instead relies on the programmer to juggle with event structures and conditionals to react on external changes and catching every condition. In functional programming the problem has been solved for years.

Also another HUGE shortcoming of LabVIEW: Lack of associative arrays (aka hash maps). There are some implementations on LAVA and OpenG, but they're very lacking, compared with what's easily possible in other programming environments. And something more sophisticated like AVL trees? Ugh…