BreakPoint

cancel
Showing results for 
Search instead for 
Did you mean: 

Rube Goldberg Code


@crossrulz wrote:

@cbutcher wrote:

I want to continue to be sarcastic, but I suppose text files for data are pretty popular.

Not that it applies to TDMS files... 😕


Yes, CSV (Comma Separated Values) and tab delimited text files (my preference) are very common.  But if you are using a TDMS file, you should use the natural data type instead of converting to a string.  It is optimized for writing data of different data types.


So we should mix strings and numbers? Since it's optimized for different data types? 😊

0 Kudos
Message 2161 of 2,571
(11,244 Views)

@Yamaeda wrote:

https://forums.ni.com/t5/LabVIEW/verification-of-my-software-code-for-best-practice/m-p/4027167#M115...

I'm not sure if the dude is trolling us or not, but i'm pretty confident 'best practice' doesn't include code duplication, no loops, open vi ref to access callers vi ref to use invoke nodes on caller ...

Includes nuggets such as:

Code review 1.png


Some additional comments:

 

  • ...and if the booleans differ, we would autoindex on a boolean array.
  • Of course we could just enable/show the visibility checkbox in the plot legend.
  • Here it might also be important to wire the error out to the edge of the FOR loop to suppress automatic error handing (e.g. if N > the number of actual plots we would get an automatic error handler popup if so configured)

 

 

0 Kudos
Message 2162 of 2,571
(11,233 Views)

@mcduff wrote:

...

Some others from that same thread

Convert number to string data to save to TDMS. Then when reading TDMS, converting back to number, disabled at the moment.

Snap46.png

 


Oh my! I often recommend people to use tdms. I regret now not holding their hand and showing them to store the data in the original format and not to convert it to string. 

Certified LabVIEW Architect
Message 2163 of 2,571
(11,202 Views)

@thols wrote:


Oh my! I often recommend people to use tdms. I regret now not holding their hand and showing them to store the data in the original format and not to convert it to string. 


Haven't you been reading? Wiebe says you should use a mixture of types! 

It's going right on my favourite things to quote list, next to another notable Walstrism (that's a thing): Rube Goldberg Thread: Stopping VIs (see a couple of posts earlier for altenbach's post with disclaimer for context)


GCentral
Message 2164 of 2,571
(11,189 Views)

@cbutcher wrote:

@thols wrote:


Oh my! I often recommend people to use tdms. I regret now not holding their hand and showing them to store the data in the original format and not to convert it to string. 


Haven't you been reading? Wiebe says you should use a mixture of types! 

It's going right on my favourite things to quote list, next to another notable Walstrism (that's a thing): Rube Goldberg Thread: Stopping VIs (see a couple of posts earlier for altenbach's post with disclaimer for context)


Cool, my own ism!

Message 2165 of 2,571
(11,186 Views)

I was just sent drivers from a company (who I'll not name) to control a DDG.  From the company's web page:

 

"<company> is a proud certifed partner of National Instrument and a pioneer in LabView developement".  Yes, inclusive of the incorrect spelling of LabVIEW and "certified".

 

Driver is FULL of gems, but here are a few:

 

image.png

 

Note there are only unique commands. All 110 events could have been handled with 5-6 at the most.Note there are only unique commands. All 110 events could have been handled with 5-6 at the most.

 

Who needs for loops?  Also:  The case structure there only goes to 20. The last loop iteration calls an empty case and does nothing.Who needs for loops? Also: The case structure there only goes to 20. The last loop iteration calls an empty case and does nothing.

 

Every VI with a user interface ends this wayEvery VI with a user interface ends this way

 

 

Edit: Formatting.  I wouldn't be so hard on them, but I think making the claim of being "...a pioneer in LabView developement." is perhaps a bit bold 🙂

Message 2166 of 2,571
(11,118 Views)

@BowenM wrote:

Edit: Formatting.  I wouldn't be so hard on them, but I think making the claim of being "...a pioneer in LabView developement." is perhaps a bit bold 🙂


That's unfair. They're prompting discussion at the leading edge of LabVIEW development! This is a serious forum!


GCentral
0 Kudos
Message 2167 of 2,571
(11,086 Views)

@BowenM wrote:

Edit: Formatting.  I wouldn't be so hard on them, but I think making the claim of being "...a pioneer in LabView developement." is perhaps a bit bold 🙂


noun: pioneer; a person who is among the first to explore or settle a new country or area.

 

Perhaps they where the first to explore LabVIEW 25 years ago? And never updated their skills or code? "Pioneer" doesn't imply quality (by it's definition), so it could be accurate 😁.

Message 2168 of 2,571
(11,046 Views)

wiebe@CARYA wrote:

Perhaps they where the first to explore LabVIEW 25 years ago? And never updated their skills or code? "Pioneer" doesn't imply quality (by it's definition), so it could be accurate 😁.


There is some truth there.  I have worked with a few CLDs who still program as if they were using LabVIEW 4.0.  One even refused to use an Event Structure.  Every one claimed they were the best programmer in the world (just ask them).  Then I get their code and just throw it out the window.


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 2169 of 2,571
(11,040 Views)

@crossrulz wrote:

wiebe@CARYA wrote:

Perhaps they where the first to explore LabVIEW 25 years ago? And never updated their skills or code? "Pioneer" doesn't imply quality (by it's definition), so it could be accurate 😁.


There is some truth there.  I have worked with a few CLDs who still program as if they were using LabVIEW 4.0.  One even refused to use an Event Structure.  Every one claimed they were the best programmer in the world (just ask them).  Then I get their code and just throw it out the window.



 

I've known some like that myself.

Message 2170 of 2,571
(11,028 Views)