BreakPoint

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

Rube Goldberg Code

I see code as shown by Jason (#4) and Darren (#2) all the time...  Especially Darren's example.

Smiley Surprised

Then again, I've been corrected by much simpler code while posting answers to this forum, too.. 

where's the smiley-guilty icon???  :womanwink:

______________________________________________________________________
Message 11 of 2,066
(16,619 Views)
we are probably all guilt of these bits of code sometime or another.
 
watch out the person whom professes to be innocent and posts example code on these types of forums.Smiley Very HappySmiley Very HappySmiley Very Happy
Regards
Ray Farmer
Message 12 of 2,066
(16,597 Views)

Here is another one.

I included both states just incase you thought there may have been a goode reason hiding in the other state.

Here is another in the same VI

Ben

Message Edited by Ben on 01-23-2007 01:28 PM

Message Edited by Ben on 01-23-2007 01:31 PM

Message Edited by Ben on 01-23-2007 01:31 PM

Message 13 of 2,066
(16,510 Views)
I've seen the array size/indexing thing a LOT before...I wonder if there's an easier way we could teach new users how auto-indexing works...
 
-D
DNatt, LV R&D
Message 14 of 2,066
(16,500 Views)
Ben,

I have them all over some code I inherited from a previous employer at our company.

I honestly studied it for a while thinking ther HAS to be some significance to that code (Regarding the error cluster).  I mean, come on.....

In the end I convinced myself I WAS actually sane (Something I feel I have to do on an almost daily basis)  and it had no purpose whatsoever.

Shane.

Message Edited by shoneill on 01-23-2007 10:49 PM

Using LV 6.1 and 8.2.1 on W2k (SP4) and WXP (SP2)
Message 15 of 2,066
(16,487 Views)


@Ben wrote:

Here is another one.


We defined Rube Goldberg code as "exceedingly complex LabVIEW code that performs simple tasks in very indirect and convoluted ways" (see first post).

This (and some of the examples shown earlier)  is now actually a Rube Goldberg NOP (or Rube Goldberg NOOP), freshly defined as:

"exceedingly complex LabVIEW code that performs absolutely nothing in very indirect and convoluted ways". Smiley Very Happy

(We could also define the construct as a WEQ (wire equivalent code), code that can be replaced with a plain wire without any change in functionality. Smiley Wink)


LabVIEW Champion Do more with less code and in less time
Message 16 of 2,066
(16,429 Views)

First the legal stuff:

Warning: The code posted previously was written by "proffesionals". Do NOT attempt to write this code yourself.

 

Excellent point Christian. (Leave ti to one our academic types to recognize when we need a new term Smiley Very Happy ).

Just to help me understand the differences...

WEQ's are identity operations and satisfy the condition

A = B

where:

A = Input

B =Output

Can we say the same about RG-NOP's?

Shane wrote;

"

Ben,

I have them all over some code I inherited from a previous employer at our company.

I honestly studied it for a while thinking ther HAS to be some significance to that code (Regarding the error cluster).  I mean, come on.....

In the end I convinced myself I WAS actually sane (Something I feel I have to do on an almost daily basis)  and it had no purpose whatsoever.

Shane.

"

That construct is all over this code I recieved. I wonder if it was the same developer or if they both came from the same LV school of thought.

After stepping outside the "Good Developer Box" for a second it hit me what that code was for!

It is a very handy way to make sure the sub-VI does not return an error. If the sub-VI is failing, just switch the boolean constant to false! Smiley Surprised Smiley SadSmiley Mad

The the very thought alone gave me the sensation of "finger-nails on the chalk board".

If this is indeed the case, then the code I posted is not RGC or RG-NOP or WEQ...

It's a hack!

Ben

 

Message 17 of 2,066
(16,408 Views)

LOL !!! @ Ben!!!!

Whoever coded that must have worked here (customer) too!!!

Now talk about useless code!!!!  If it's No Error, then nothing is done to the error cluster values.  If there was an error, the status was ALREADY TRUE!!, so again no change!!!

I'm spending hours upon hours at changing code like this..  

 

 

______________________________________________________________________
Message 18 of 2,066
(16,391 Views)
Here's another WEQ, straight from the forum Smiley Happy:
 
 

Message Edited by altenbach on 01-24-2007 01:31 PM


LabVIEW Champion Do more with less code and in less time
0 Kudos
Message 19 of 2,066
(16,379 Views)
Hey Ben,

"It's a hack!"

You're forcing me back to another round of sanity checks.....

Somehow I always knew LabVIEW was referring to ME when it complained about "Insane Objects"......

Shane
Using LV 6.1 and 8.2.1 on W2k (SP4) and WXP (SP2)
Message 20 of 2,066
(16,366 Views)