BreakPoint

cancel
Showing results for 
Search instead for 
Did you mean: 

An example of simply atrocious code

Holy crap... I honestly cannot believe that someone coded this. It's like there was an earthquake in the block diagram and the programmer was on LSD. It seems more like he was trying to paint a picture rather than write code. There is literally subVI that takes a string of nubmers, indexes each item in a string, converts that digit to I32, then multiplies by 10^x to create an array. Then he sums the array. It's absurd. Here's what I mean:

Bad Code Example 2.PNG

 

And I've just been tasked with finding one little subVI and updating it for our new oven controller. Joy.

 

And here's about 1/2 the diagram:

Bad Code Example.PNG

 

God help me...

0 Kudos
Message 1 of 4
(9,996 Views)

I feel your pain. Was mostly doing LabVIEW consulting for the last several years, inherited a lot of mediocre to atrocious code. Have settled at a company now where the lead has produced a pretty slick architecture and is pretty much a diagram "neat freak" so it is coherent and pleasant to look at. Hang in there my friend!

Putnam
Certified LabVIEW Developer

Senior Test Engineer North Shore Technology, Inc.
Currently using LV 2012-LabVIEW 2018, RT8.5


LabVIEW Champion



0 Kudos
Message 2 of 4
(9,987 Views)

Wow.  Your example of Rube Goldberg could have been totally done with a node that was used in the Rube Goldberg (string to number).

 

Cheer up.  My first inherited code looked a lot like that.  I was still in my LabVIEW infancy, but I claimed that I could spend a week fixing the code or totally rewrite it in a day.  I was allowed totally rewrite it and I had an initial coding done in the day.  I spent another day fixing small bugs.  I doubt you are that lucky right now.  But think of this as a chance to show people what NOT to do.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 3 of 4
(9,953 Views)

@dthor wrote:

Holy crap...

 

And I've just been tasked with finding one little subVI and updating it for our new oven controller. Joy.

 

God help me...


Brother I feel for you. But it could have been worse.....

BTNT.PNG


"Should be" isn't "Is" -Jay
Message 4 of 4
(9,945 Views)