BreakPoint

cancel
Showing results for 
Search instead for 
Did you mean: 

Rube Goldberg Code


AnalogKid2DigitalMan wrote:

Wow! Dennis found an Express vi in the pallettes 🙂

 

-Ak2DM


 

I've deleted that palette. I just happened to find it in the poster's code.Smiley Wink
Message 441 of 2,560
(11,863 Views)

A truly painful experience when looking at the VI here

Message 442 of 2,560
(11,800 Views)

Dennis Knutson wrote:

A truly painful experience when looking at the VI here


 

In that one, I particularly like where they used an index array that had hundreds if not more than a thousand possible elements indexed out, but they only actually use about 1 in every 12-20 to use 80 elements.  The index array node is about 10 screens tall.

 

What is fun on these is to use the Clean up block diagram on these and see how LabVIEW rearranges everything.  The neatness of the evenly spaced parallel lines is kind of pretty.

Message 443 of 2,560
(11,774 Views)

In order to stop a loop we absolutely have to flip a Boolean value several times, just to make sure we've got it right:

 

 

from here.

Message 444 of 2,560
(11,708 Views)
Well, if two wrongs make a right, then three wrongs make a wrong. Smiley Very Happy  Factor in there is another inherent negation of the condition of the while loop since it can be set to either Stop when True or Continue When True.
0 Kudos
Message 445 of 2,560
(11,700 Views)

What I think - that most of "Rube Goldberg" snippets was created not from scratch, but during iterative development.

I mean that we adding functionality step by step, then going to such "crazy" code sometimes.

Adding arrays, bundle, undbundle, then bundle again, strtange changes in boolean logic many times...

Here just one recipe (except having good specification and design): REFACTORING.

I do it time to time when time permit. Also we reserving some time just for clearing the code (without adding new functionality).

Look here - this is screenshot of one "spaghetti" place from one of our project right now:

 

 

Good enough for ten years LabVIEW experience?

Why it happend? Because was changed lot of times during changed specs by different engineers.

Also again - refactoring, refactoring, refactoring!

 

Andrey.

 

Message Edited by Andrey Dmitriev on 04-17-2009 04:39 PM
Message Edited by Andrey Dmitriev on 04-17-2009 04:40 PM
Message 446 of 2,560
(11,697 Views)

Andrey Dmitriev wrote:

 refactoring, refactoring, refactoring!


One thing that can help is an architecture that lends itself to scaling.

 

Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

0 Kudos
Message 447 of 2,560
(11,682 Views)

jcarmody wrote:
One thing that can help is an architecture that lends itself to scaling.

Just like you're dealing with a fish - scrape down the scales and leave them behind. 😛

 

      Rob

0 Kudos
Message 448 of 2,560
(11,680 Views)

Can you subtract 1 using only a FOR loop???

 

Some do! 😄

 

 

(spotted here)

Message Edited by altenbach on 04-18-2009 12:07 PM
Message 449 of 2,560
(11,640 Views)

altenbach wrote:

Can you subtract 1 using only a FOR loop???

 

Some do! 😄

 


Not really the same for the particular case when xScans == 0. So, here we have "intellectual" subtraction combined with kind of thresholding 🙂

 

Andrey.

 

0 Kudos
Message 450 of 2,560
(11,595 Views)