03-03-2014 06:29 AM
Altenbach,
I'd argue that example is not truly a Rube Goldberg, but definitely belongs in the Why some people say Local Variables are bad... thread.
03-03-2014 08:51 AM - edited 03-03-2014 08:55 AM
I agree with RF.. 🙂
By the way... the seen here link simply opens the image... not the thread where it is discussed.
03-03-2014 09:05 AM
For posterity (and for steak):
http://forums.ni.com/t5/LabVIEW/Ligar-vi-a-otros-vi/m-p/2761320#M813977
03-03-2014 09:12 AM
I don't know.. there's a lot of RG there:
Lets see.. take a number. take an equals compairison of it with itself. AND with the same number equal to zero. Instead of just checking if number equals zero.
Repeat 5 times.
I'm sure there's more in the case statement but I don't see the other case so won't comment on that.
plus. I love that we have to write 13 to %IVA every time through the loop.
@altenbach wrote:
Ouch! (seen here)
"I won't be wronged. I won't be insulted. I won't be laid a-hand on. I don't do these things to other people, and I require the same from them." John Bernard Books
03-03-2014 09:37 AM
@bsvare wrote:
I don't know.. there's a lot of RG there:
Lets see.. take a number. take an equals compairison of it with itself. AND with the same number equal to zero. Instead of just checking if number equals zero.
Repeat 5 times.
Still not really a Rube Goldberg. A RG is having a structure that does the job, but takes far more steps than necessary. You could probably simplify this code a bit, but in the end it still doesn't do anything.
It really is an abuse of local variables. My gut feel is that they were trying to detect when the control had changed, then proceed to do something. (Using google translate on the original message mentioned something about it being a vending machine app.) But when you are programmer, and you have no clue as to what it is you are really trying to do and how to lay out the logic of it, the obvious solution is to just throw in more local variables and hope that the code magically starts working the way you want.
03-03-2014 09:38 AM
03-03-2014 10:22 AM
@bsvare wrote:
I don't know.. there's a lot of RG there:
I agree. I summarized my own finding here. We really need to see the actual VI. Another RG point is scalability. Imagine if they would need to expand that restaurant app (or whatever that is). to 200 items in the future.
(But yes, it also has a place in the local variable thread, but I thought there is no need to create duplicate posts. I thought the RG'ness was dominant here :D)
03-03-2014 12:31 PM - edited 03-03-2014 12:32 PM
This is the case of a Rube Localsberg... Code abuse that involves Local Variables.
Posting in both threads is okay, since there is abuse in both forms of code (overcomplexity and Locals).
03-04-2014 02:14 AM
Perhaps a suitable posting strategy would have been to have a post in the RG thread linking to the local variables thread, in which there's a post linking back to another post regarding the VI in the RG thread?
03-06-2014 09:46 PM
The poster in this thread any examples of vi scripting an array??. seems to want to reshape a 2-D array to a 3-D array. (not sure because thread hasn't be resolved yet.).
The catch to this thread wasn't just using code that looks like below as a RG for reshaping array. The bigger RG is asking to use VI scripting to programmatically build the Rube Goldberg.