BreakPoint

cancel
Showing results for 
Search instead for 
Did you mean: 

Rube Goldberg Code


@johntrich1971 wrote:

@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.


You should have heard that from me first... because I am the best!


"Should be" isn't "Is" -Jay
0 Kudos
Message 2171 of 2,565
(12,452 Views)

This morning I went looking where I shouldn't have gone looking. Found nothing but sadness:

search 1D array.PNG

If you're gonna hard code (nothing against it), why not do it legibly? And why not use a search 1D array?

 

 

many cases.PNG

And what is up with this?

 

Sad thing is, I only went looking, because a function that was supported according to the documentation, just... wasn't.



Remember Cunningham's Law
Message 2172 of 2,565
(12,407 Views)

@PeterFoerster wrote:

 

If you're gonna hard code (nothing against it), why not do it legibly? And why not use a search 1D array?

 


Ouch!

 

Yes, a single 1D string array constant and search array*. Wire the (-1?) output directly tho the case structure and include the "#" as part of the format instead of pre-pending it later. 😄

 

*Actually, a map constant would be even better! 😄

Message 2173 of 2,565
(12,394 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 quote from Fab goes something like "You say you have 5 years of LabVIEW experience, but really you just have 1 year repeated 5 times."

Message 2174 of 2,565
(12,332 Views)

We talked about Aztec architecture elsewhere. Here's another example to clean up a string:

 

altenbach_0-1586455136019.png

 

Message 2175 of 2,565
(12,281 Views)

@altenbach wrote:

We talked about Aztec architecture elsewhere. Here's another example to clean up a string:

 

altenbach_0-1586455136019.png

 


That post inspires a new LabVIEW Proverb that is not quite ready for prime-time but goes something like...

 

Those that fail to study history read the help for LabVIEW are doomed to repeat rewrite it.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 2176 of 2,565
(12,313 Views)

@altenbach wrote:

We talked about Aztec architecture elsewhere. Here's another example to clean up a string:

 

altenbach_0-1586455136019.png

 


This and the previous example are typical of many old style instrument drivers that originate from early LabVIEW times. Partly because many of the more powerful functions like the RegEx and similar simply weren't there.

Although the Match Pattern was present and was IMHO greatly underused, most likely because of its not trivial RegEx like syntax. So when seeing such code it could be that it is simply just an archeological find rather than an incapable programmer. 😀

And yes the OCD in me is very inclined to just change that code to a cleaner, modern representation but I just finished an assignment with a customer where that wasn't appreciated to much as any code change anywhere had to be first logged as a Jira ticket, reviewed and assigned to a Scrum Sprint and eventually then be implemented and committed. Such a process really makes you think more than twice about changing code that isn't yet failing in a proofable way. 😁

Rolf Kalbermatter
My Blog
Message 2177 of 2,565
(12,297 Views)

@rolfk wrote:

And yes the OCD in me is very inclined to just change that code to a cleaner, modern representation but I just finished an assignment with a customer where that wasn't appreciated to much as any code change anywhere had to be first logged as a Jira ticket, reviewed and assigned to a Scrum Sprint and eventually then be implemented and committed. Such a process really makes you think more than twice about changing code that isn't yet failing in a proofable way. 😁


What about other things (cough... processes... cough...) that aren't yet failing in a provable way? 🙂

 

Although I imagine the process is mandated by some restrictions based on safety, industrial regulation, etc etc...

 

 


GCentral
0 Kudos
Message 2178 of 2,565
(12,289 Views)

Ah Jira and Scrum meetings. We were always throwing our scrum cards out to "estimate" the time that something would take, and I was always protesting that not enough information was being given before I was to vote. It ended up with me usually being the highest time estimate.

 

RegEx is a whole "programming" language, requiring quite a bit of learning in itself. I have used it, in a basic sense, but never mastered it to do some of the "kewl" stuff (I work with some younger, kewler" engineer) that I have seen done.

Putnam
Certified LabVIEW Developer

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


LabVIEW Champion



0 Kudos
Message 2179 of 2,565
(12,222 Views)

I told a junior engineer to learn some RegEx just last week.  Now he has two problems!

Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

Message 2180 of 2,565
(12,198 Views)