BreakPoint

cancel
Showing results for 
Search instead for 
Did you mean: 

The Boneheaded Code Thread

Kudos Ben! That is the spirit I had in mind for this thread. If this were a book a good title might be "Brave Confessions of the Brain Dead Software Engineer"

 

Let's keep 'em coming!

=====================
LabVIEW 2012


0 Kudos
Message 11 of 21
(11,085 Views)

OK I'll play too.

Task: Jeff quick set up a vi to cycle a temperature chamber up and down all night with this recording device in the chamber.  We want to make sure these production prototypes do what they are supposed to do (Shut off when either too hot or too cold).  You have 30 Minutes to set up.

 

Here is a simplified recreation.

 

BH.png

 

 

Spoiler
We learned the plastic melts at 137C

 

Spoiler
Spoiler
The AND is bad!!! shouldn't that be an OR?
I've since learned how to use In Range And Coerce

 

 

 

 

 

 


"Should be" isn't "Is" -Jay
Message 12 of 21
(11,054 Views)

I must have had a hundred bugs that were due to me reversing the True and False cases, or using Less Than when I should have used Greater Than.  Almost seems like I do it wrong more than 50% of the time.

0 Kudos
Message 13 of 21
(11,039 Views)

Yeah, I've been there Jeff.  My recent boneheaded mistake was checking to see if an element want found in an array (Search 1D Array) and set the comparison to >0.  It took me awhile before I realized that it's >=0.


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
Message 14 of 21
(10,997 Views)

@drjdpowell wrote:

I must have had a hundred bugs that were due to me reversing the True and False cases, or using Less Than when I should have used Greater Than.  Almost seems like I do it wrong more than 50% of the time.



They're like USB connectors.  50% chance of getting it in the right way the first time, and 80% of the time you get it wrong.

Message 15 of 21
(10,986 Views)

Odd...I find that if I have a 50% chance of getting it right, I have a 100% chance of getting it wrong.

 

SnowMule is either smarter or luckier than I am.  Smiley Very Happy

Message 16 of 21
(10,976 Views)

Also, you're not subtracting the step from the previous value, but the previous value from the step? This means on the first attempt to reverse direction you end up with a negative temperature (once you fix the boolean logic error)?

 

subtract.jpg

Thoric (CLA, CLED, CTD and LabVIEW Champion)


0 Kudos
Message 17 of 21
(10,945 Views)

@Thoric wrote:

Also, you're not subtracting the step from the previous value, but the previous value from the step? This means on the first attempt to reverse direction you end up with a negative temperature (once you fix the boolean logic error)?

 

subtract.jpg



go figure! recreate a bonehead mistake and make another! Smiley Embarassed


"Should be" isn't "Is" -Jay
Message 18 of 21
(10,943 Views)

In benckmarking code, why the @#$@#$!#$!#$!#$!#$!#$ won't my two sums come out the same do my two sums SOMETIMES come out the same:headbang:

 

 

 

0 Kudos
Message 19 of 21
(10,882 Views)

Just looking at the picture, they will be the same if you have fewer than 256 matches. 😄

Message 20 of 21
(10,873 Views)