BreakPoint

cancel
Showing results for 
Search instead for 
Did you mean: 
Reply

Rube Goldberg Code

(seen here)

 

If the programming technique is to add more and more code (and never delete anything) until the output is as expected, we would get something like that:

 

(Six scalar booleans to six arrays with one element each to six dynamic data wires, joined into one dynamic data wire and transformed back to a boolean array with six elements. Smiley Surprised)

 

 Booooooleans.png

 


LabVIEW Champion Do more with less code and in less time
Message 2061 of 2,065
(620 Views)

(Seen here)

 

A circuitous odyssey from "array of DBL" to "array of strings" via one long string and some meaningless second format statement:

Capture3.PNG

 

Could be replaced by a single primitive. Smiley Very Happy

 

fract.png


LabVIEW Champion Do more with less code and in less time
0 Kudos
Message 2062 of 2,065
(433 Views)

Worse than the classic bundle cluster to array dance because it is an index array, to bundle cluster, back to array Cha-Cha.

Also, just before this some extra code to take any incoming waveform array and delete is all, so that you can be sure to append new arrays to an empty array.

 

Seen here.

 

PowerMonitoring-1_BD    PowerMonitoring_BD

 

0 Kudos
Message 2063 of 2,065
(284 Views)

If two functions are near each other (GCD here), it is likely that they can be combined into a single instance. Always worth looking for that possibility:

 

smallerGCD.png


LabVIEW Champion Do more with less code and in less time
Message 2064 of 2,065
(202 Views)

Having a boolean labeled "Start Stop" and some loop termination depending on it set to "stop if true", some set to "continue if true" and some having a "not function" in the wire right before the condition certainly does not result in code that can easily be understood.

 

(seen here)

 

parallel while loop.jpg


LabVIEW Champion Do more with less code and in less time
0 Kudos
Message 2065 of 2,065
(193 Views)