BreakPoint

cancel
Showing results for 
Search instead for 
Did you mean: 

Rube Goldberg Code

I formalized this pattern (including Enum to Array of Enums.vim) as the Natt Sequence.

Message 2401 of 2,571
(2,464 Views)

@Darren wrote:

I formalized this pattern (including Enum to Array of Enums.vim) as the Natt Sequence.


I knew that, but couldn't find it. In hindsight Google for "Natt Sequence LabVIEW", gives it as 1st hit...

 

I have my own Enum To Array of Strings, as I often report enumerable items in text reports.

0 Kudos
Message 2402 of 2,571
(2,382 Views)

Honestly @altenbach, i'm kind of disappointed in your for not posting the constipated loop thread yet.

 

Although that isn't as much Rube Goldberg code as it is Cronenberg code.

0 Kudos
Message 2403 of 2,571
(2,325 Views)

@AeroSoul wrote:

Honestly @altenbach, i'm kind of disappointed in your for not posting the constipated loop thread yet.

 

Although that isn't as much Rube Goldberg code as it is Cronenberg code.


I have been (and still am!) traveling with very spotty web access. Just switched to my phone AP because the hotel wifi is so abysmal! Grrr....

0 Kudos
Message 2404 of 2,571
(2,273 Views)

@maflAT wrote:

Someone heard that stacked sequences are bad so he came up with this genius alternative:

maflAT_0-1655570380546.png

The boolean is unwired in all other cases.

This structure is spammed literally 100s of times throughout the program I'm currently working on. Most of the time it only has 2 or 3 cases but sometimes it's 30+.


Actually, 20 years ago that was common.  The old LabVIEW Test Executive made use of of it although, default stop conditions and error cluster wire colors were different.  The counter for the next state even broke if the next state wasn't wired since default if unwired tunnels didn't exist until the Event Loop came along.

 

You could even select the next state to be something like 100 if there was an error.

 

Yep, "On Error GOTO 100!"

 

Fire is still fire but we use better tools to create and control it now.


"Should be" isn't "Is" -Jay
0 Kudos
Message 2405 of 2,571
(2,188 Views)

@JÞB wrote:

You could even select the next state to be something like 100 if there was an error.

 

Yep, "On Error GOTO 100!"

 

Fire is still fire but we use better tools to create and control it now.


Interesting you mention that... I recently came across some code that shipped as an example for a driver that used numbers to provide states, but the meaning of the numbers was controlled by local variables, which were set using an Event Structure.

 

Given the presence of the EvStr, I figured the code couldn't be all that old... But working out what was going on with the states was a bit of a pain... (What does 100 mean? Did something change the content of the "100" local variable to another number? Why are there even local variables being used to change the numeric values of variables with numeric names, if the value isn't the name, and why are they being read to determine the next state in the state machine? 😕 )


GCentral
0 Kudos
Message 2406 of 2,571
(2,184 Views)

@cbutcher wrote:

@JÞB wrote:

You could even select the next state to be something like 100 if there was an error.

 

Yep, "On Error GOTO 100!"

 

Fire is still fire but we use better tools to create and control it now.


Interesting you mention that... I recently came across some code that shipped as an example for a driver that used numbers to provide states, but the meaning of the numbers was controlled by local variables, which were set using an Event Structure.

 

Given the presence of the EvStr, I figured the code couldn't be all that old... But working out what was going on with the states was a bit of a pain... (What does 100 mean? Did something change the content of the "100" local variable to another number? Why are there even local variables being used to change the numeric values of variables with numeric names, if the value isn't the name, and why are they being read to determine the next state in the state machine? 😕 )


Sounds like somebody tried to write an Abstraction layer that was really an obfuscation layer.


"Should be" isn't "Is" -Jay
0 Kudos
Message 2407 of 2,571
(2,178 Views)
0 Kudos
Message 2408 of 2,571
(2,158 Views)

I'll post it then, if altenbach can't.

 

AeroSoul_0-1656329576498.png

 

Seen here

Message 2409 of 2,571
(2,140 Views)

wiebe@CARYA wrote:

@cbutcher wrote:
What does 100 mean?

loo | Etymology, origin and meaning of loo by etymonline


I may have dated myself.  GOTO <line> was a syntacticly correct statement in Applesoft BASIC

 

Since processors of the day had about the same memory as an abacus programming was done with either machine code or an interpreted language.   BASIC interpreted each statement line by line and each line was identified by a unique unsigned integer.  Common practice was to count by 10 so you could easily insert a few more lines .

 

Unfortunately you never compiled the whole program so if there was a Syntax Error the program halted an reported "Error on line <line#>" and then you had to figure out the error yourself.

 

A GOTO cleanup code on Error was not an option!  So, "On Error GOTO 100" was the unreachable holy grail of code perfection in any interpreted language. 


"Should be" isn't "Is" -Jay
0 Kudos
Message 2410 of 2,571
(2,115 Views)