BreakPoint

cancel
Showing results for 
Search instead for 
Did you mean: 

Rube Goldberg Code

A bit more complicated than needed to be..  Locals are used to turn boolean indicator ON/OFF (green/dark)

There's actually no need to refresh the boolean with every iteration of the loops nor use a Local where there is a perfectly unused indicator nearby.

 PM



Message Edited by JoeLabView on 05-22-2008 09:28 PM
0 Kudos
Message 261 of 2,635
(13,134 Views)
And the usual "It's TRUE" no matter what..
 


Message Edited by JoeLabView on 05-22-2008 09:43 PM
0 Kudos
Message 262 of 2,635
(13,131 Views)
OK, we want to append a single element to an array kept in a feedback node.
 
Here's the twisted version:
 
Turn the element into an array with one element and then use "insert into array" to insert the existing array from the feedback
node into the single-element array at position 0, effectively pushing the new element at the end.
 
Points for acrobatic achievement!!! 😄 (throw in some right-to-left wires and overlapping objects for extra confusion :o).
 


Message Edited by altenbach on 05-22-2008 10:29 PM
0 Kudos
Message 263 of 2,635
(13,123 Views)


altenbach wrote:
Here's the twisted version:

Sorry, forgot to quote the source: http://forums.ni.com/ni/board/message?board.id=170&view=by_date_ascending&message.id=325844#M325844
0 Kudos
Message 264 of 2,635
(13,085 Views)
Where to start...
 
 
 
Code portions are run before the loop, inside the loop and others inside the loop and after the loop. 
 
Plus overusing Locals is not a pretty sight.. 
 
0 Kudos
Message 265 of 2,635
(13,005 Views)

So where's the Rube Goldberg?    I don't see it...

Apart from the really bad wiring, I don't see much wrong anyway...     

He's using locals for wiring status indicators...     I wonder, is that really that much worse than using property nodes?    Locals do improve on readibility.    
That you have initiation code before a loop doesn't seem weird to me...  

 

edit:  Oh ok...  That error line for stopping the loop...    Oh Boy....    Smiley Surprised



Message Edited by Anthony de Vries on 05-29-2008 03:23 PM
Message 266 of 2,635
(12,991 Views)

@Anthony de Vries wrote:

So where's the Rube Goldberg?    I don't see it...


That's a good point, and one that I've brought up before in this thread. Even though you pointed out the method used with stopping the loop, which admittedly is "Rube Goldberg-ish", I don't see the rest of the code being in that category. Let's remember the point of this thread. I would hate to see this thread simply become an extension of the one trying to stomp on local variables.
0 Kudos
Message 267 of 2,635
(12,975 Views)

I do know this was mentionned in the Locals thread..

The Rube Goldberish code is the fact that the same functions are repeated, circled in red.  It is possible to use the ones in the loop instead of the "before" and "after".

Or maybe it's my eyesight ... 😞



Message Edited by JoeLabView on 05-29-2008 10:36 AM
0 Kudos
Message 268 of 2,635
(12,968 Views)

@JoeLabView wrote:

I do know this was mentionned in the Locals thread..


I know, since I was the one who posted the bit about the way the loop was being stopped. Smiley Wink


@JoeLabView wrote:

The Rube Goldberish code is the fact that the same functions are repeated, circled in red.  It is possible to use the ones in the loop instead of the "before" and "after".


Based on what? You don't really know what the intent of the code is, and the "before" could be used to establish a "baseline", while the use inside the code is the "operation" part of it. Just because the same function/VI is being used does not make it "Rube Goldberg". There are many times when I've done this myself, and for good reason. Smiley Wink

0 Kudos
Message 269 of 2,635
(12,962 Views)

Ok..  Mia-Culpa.

Delete from Rube Goldberg.  😉

 

0 Kudos
Message 270 of 2,635
(12,953 Views)