BreakPoint

cancel
Showing results for 
Search instead for 
Did you mean: 

Rube Goldberg Code

Highlighted

@BowenM wrote:
I think I've posted this story before, but it is one of my favorites. This reminded me of it

(Of course the hardware team will substitute a 10x faster processor in the next iteration .. BOOM!. 🐵


LabVIEW Champion. It all comes together in GCentral GCentral
What does "Engineering Redefined" mean??
0 Kudos
Message 2191 of 2,223
(969 Views)
Highlighted

@BowenM wrote:

@altenbach wrote:

Not really Rube Goldberg code, more a Rube Goldberg concept (seen here).

 

"If you quickly run out of memory, add a time delay so you run out of memory more slowly. :D"

 

(That particular code would take 5 days with the suggested delay so we can start the program on Monday and leave for the weekend without ever running out of memory. Problem solved!!!)


I think I've posted this story before, but it is one of my favorites. This reminded me of it


A troubled program being blown up in action will hunt me in my sleep.

 

Only fixing the source will send it into the light 👼.

0 Kudos
Message 2192 of 2,223
(924 Views)
Highlighted

Seen here

 

Haven't seen these in a while, but they are just the tip of the iceberg.

 

altenbach_0-1592362003369.png

 

 

Maybe somebody want to help fix all that code. It has doozies like the following.

 

altenbach_0-1592355722528.png


LabVIEW Champion. It all comes together in GCentral GCentral
What does "Engineering Redefined" mean??
0 Kudos
Message 2193 of 2,223
(817 Views)
Highlighted

That's almost as embarrassing as some of my Rube-ish attempts at coding early in my career.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 2194 of 2,223
(787 Views)
Highlighted

@billko wrote:

That's almost as embarrassing as some of my Rube-ish attempts at coding early in my career.


 

There's a saying I read somewhere, though I can't seem to find it now.  Something along the lines of:  "Good code is what you just wrote. Bad code is what your coworker just wrote. Terrible code is what you wrote 6 months ago"

 

I can't tell you the number of times I've been looking through old code and thought "oh wow. What was I thinking?!"

Message 2195 of 2,223
(736 Views)
Highlighted

Seen here

 

So we have a 1D array that should have a linear scaling applied.

 

Some programmers thing that we:

 

  1. Need to measure the length of the 1D array
  2. Take a subset of that array starting at zero and having the original length.
  3. Create arrays of the same length for two constants.
  4. Divide by one of these arrays and multiple with the other
  5. Subtract the other array

 

My gut feeling is that this could be simplified! I wonder how much the LabVIEW compiler can strip out from the original. 😄

 

 

 

altenbach_0-1593296013190.png


LabVIEW Champion. It all comes together in GCentral GCentral
What does "Engineering Redefined" mean??
0 Kudos
Message 2196 of 2,223
(666 Views)
Highlighted

The problem is simple: Take any 2D array and interleave empty rows and columns to double the size. (seen here)

 

There are many ways to do this, Here are two alternatives.

 

One of them might take less time to write, debug, and verify. 😄

Decisions, decision!

 

altenbach_0-1593873294698.png

 


LabVIEW Champion. It all comes together in GCentral GCentral
What does "Engineering Redefined" mean??
0 Kudos
Message 2197 of 2,223
(590 Views)
Highlighted

We talked about Aztec code architecture before, but it seems that some will take it to the next level and implement Mayan Code Architecture:

 

(seen here)

 

Yes, I actually visited Tikal in 1980. Quite an adventure!

 

altenbach_1-1596485689777.png


LabVIEW Champion. It all comes together in GCentral GCentral
What does "Engineering Redefined" mean??
Message 2198 of 2,223
(437 Views)
Highlighted

@altenbach wrote:

We talked about Aztec code architecture before, but it seems that some will take it to the next level and implement Mayan Code Architecture:

 

(seen here)

 

Yes, I actually visited Tikal in 1980. Quite an adventure!

 

altenbach_1-1596485689777.png


But it's OK because he left out more bad code. 🤣

Message 2199 of 2,223
(402 Views)
Highlighted

One would think that having a single 2D array shift register receiving a row would be slightly simpler than 28 (!!) 1D arrays, each receiving a scalar per iteration. ( very small code section seen below)

 

(seen here).

 

What hurts the eye (and brain!) even more is all these detours via shorts stretches of dynamic data. Yuk! I am not even trying to figure out what they should do.

 

 

altenbach_0-1596731478199.png

 


LabVIEW Champion. It all comes together in GCentral GCentral
What does "Engineering Redefined" mean??
Message 2200 of 2,223
(315 Views)