News for hackers. Stuff that matters.
Re:Ask HN: Why isn’t visual programming a bigger thing? by globular-toast on Thursday May 21, 2020 @04:41AM (#23256156)
I was recently involved in a LabView eviction. I was shocked to discover that one of the modules which looked superficially complicated was actually "short circuited" and most of the logic was not contributing to the final output. At a glance it looked like everything was wired up, but looking closely there was a single missing link that completely changed what the module did. That was enough to convince me that it's a toy and nothing serious should be attempted with it.
Re:Ask HN: Why isn’t visual programming a bigger thing? by ironmagma on Thursday May 21, 2020 @05:48AM (#23256541)
How is that different though from forgetting to pass in an argument into a variadic function, or having a spurious early return? To the untrained eye, both those scenarios would present the same.
Re:Ask HN: Why isn’t visual programming a bigger thing? by hodgedual on Thursday May 21, 2020 @06:17AM (#23256725)
Any compiler or linter would likely complain about unused variables or code in such a situation.
Re:Ask HN: Why isn’t visual programming a bigger thing? by neltnerb on Thursday May 21, 2020 @08:10AM (#23257426)
The labview "linter" is of course weirder but I think this is basically one.

https://zone.ni.com/reference/en-XX/help/371361R-01/lvvianal...

PS. Please don't take this as an endorsement of labview. It has its place in non-CS fields when there's high turnover so it's really bad if only the group's current programmer understands it. Talking academia here, I probably wouldn't use it in a more stable environment.

Re:Ask HN: Why isn’t visual programming a bigger thing? by benibela on Thursday May 21, 2020 @08:09AM (#23257420)
Not if a part of the variable is used

I just had this problem in a GUI. There was an edit view, correctly created and initialized with a default value. Then the user could enter a value, but whatever the user entered would be ignored.

Re:Ask HN: Why isn’t visual programming a bigger thing? by neltnerb on Thursday May 21, 2020 @08:42AM (#23257696)
How did you manage that?

TLDR -- Event structures are my favorite new feature. Try them out and see if you still hate LabView nearly as much. I also suggest not actually using any of your GUI variables. Treat these like declarations and use local variables everywhere else. Otherwise the wires are impossible to trace and buggy to change.

You've probably fixed it, but you can configure it to execute a code block when a value changes with Event structures.

This structure is a little new, but I started LabView before it existed so I only started using it in the last year or two.

It lets you define code to execute based on interrupt style events like "mouse release" on a button whereas in older versions I would wrap all my button checking logic inside of a big timed or while loop because otherwise as you've noted it won't update the value when doing the logic check.

So my old standard style would be that there's a timed loop around each case structure that is checking buttons at 1kHz against a local variable version of the button's boolean, with a sequence inside the case structure that always resets the button state to zero at the end. Otherwise it doesn't check for button presses if one has already been pressed and is running something, or if you have no while/timed loop it doesn't even check at all since it's a run-once program.

LabView patterns are really not very clear, and my least favorite bit is that there's at least ten ways to do anything, and only one or two are good but the others all logically seem like they should work until you look really close.

Edit: Or maybe my least favorite part is that despite being a system designed for instrumentation and controls and data acquisition, my god is it a pain to plot anything.

Re:Ask HN: Why isn’t visual programming a bigger thing? by benibela on Saturday May 23, 2020 @11:34AM (#23283754)
> How did you manage that?

I probably started coding, and then forgot to finish it ...

(not in LabView to be clear)

Re:Ask HN: Why isn’t visual programming a bigger thing? by darkerside on Thursday May 21, 2020 @08:47AM (#23257738)
Indentation errors in Python can similarly short circuit control flow and are easy to miss for less trained eyes. Disclaimer: I actually love Python.