04-10-2009 04:18 PM
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.
04-15-2009 09:46 AM
A truly painful experience when looking at the VI here.
04-15-2009 12:00 PM
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.
04-17-2009 09:23 AM
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.
04-17-2009 09:37 AM
04-17-2009 09:39 AM - edited 04-17-2009 09:40 AM
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.
04-17-2009 11:30 AM
Andrey Dmitriev wrote:refactoring, refactoring, refactoring!
One thing that can help is an architecture that lends itself to scaling.
04-17-2009 11:35 AM
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
04-18-2009 02:06 PM - edited 04-18-2009 02:07 PM
Can you subtract 1 using only a FOR loop???
Some do! 😄

04-20-2009 12:44 AM
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.