BreakPoint

cancel
Showing results for 
Search instead for 
Did you mean: 

Why some people say Local Variables are bad...

And another candidate for how not to write LabVIEW code (but how to write text-based code using LabVIEW icons): http://forums.ni.com/t5/LabVIEW/Compatibility-of-windows-xp-with-labview-and-windows-2000-with/td-p/...

 

Message 261 of 396
(8,182 Views)

roffle... i love the "//comments".

0 Kudos
Message 262 of 396
(8,166 Views)

@smercurio_fc wrote:

And another candidate for how not to write LabVIEW code (but how to write text-based code using LabVIEW icons): http://forums.ni.com/t5/LabVIEW/Compatibility-of-windows-xp-with-labview-and-windows-2000-with/td-p/...

 


That VI looks like a Flying Spaghetti Monster wearing gigantic, colorful mittens. Also reminds me how much I like the smaller locals we got a year ago, I think (too lazy to look it up) an Altenbach Idea.

 


 

Richard






0 Kudos
Message 263 of 396
(8,148 Views)

@broken Arrow wrote:

@smercurio_fc wrote:

And another candidate for how not to write LabVIEW code (but how to write text-based code using LabVIEW icons): http://forums.ni.com/t5/LabVIEW/Compatibility-of-windows-xp-with-labview-and-windows-2000-with/td-p/...

 


That VI looks like a Flying Spaghetti Monster wearing gigantic, colorful mittens. Also reminds me how much I like the smaller locals we got a year ago, I think (too lazy to look it up) an Altenbach Idea.

 


 


NO NO NO there are no locals in Spaghetti.vi

 


"Should be" isn't "Is" -Jay
0 Kudos
Message 264 of 396
(8,124 Views)

seen here

A masterpiece of codestench every anti-pattern is in there somewhere.  VI analizer took forever and found dup control names and unused code!

The

Untitled.png


"Should be" isn't "Is" -Jay
Message 265 of 396
(8,039 Views)

I wish I could edit the first post.  I think we DO need to discuss what's wrong with using Locals within this thread and possibly offer examples to how to improve the code, similar to the Rube Goldberg thread.   Maybe changing the title of the thread itself...

0 Kudos
Message 266 of 396
(7,939 Views)

This thread is already 10s of pages long, the rube thread has over 1000 posts. If people were encouraged to discuss posts as well, I think it might get out of hand - although probably not as badly as the up/down convert threads.

 

Maybe we could have another LabVIEW sub-board called "LabVIEW Pitfalls to Avoid" or similar, where people are encouraged to post examples of bad code, and discuss how they might be improved. Off my head, topics might include examples of:

 

- Local variable abuse

- Globals variable abuse

- FGV abuse

- Obfuscated code

- Rube code

- Race conditions

- Misuse of the synchronisation palette

_____________________________
- Cheers, Ed
0 Kudos
Message 267 of 396
(7,933 Views)

Ray.R said
I wish I could edit the first post.  I think we DO need to discuss what's wrong with using Locals within this thread and possibly offer examples to how to improve the code, similar to the Rube Goldberg thread.   Maybe changing the title of the thread itself...

Feel free to start a new thread or I can edit the first post/title for you. I just need to know what you'd like it to say
Jordan
0 Kudos
Message 268 of 396
(7,917 Views)

Thanks Jordan,

 

I knew you monitored the forum, but didn't realize you monitored it so closely.. 😉  🙂

 

I would simply remove the following from the first post:

PLEASE do not discuss using or not using Locals in this thread. 

 

Thanks,


RayR

0 Kudos
Message 269 of 396
(7,898 Views)

@yenknip wrote:

This thread is already 10s of pages long, the rube thread has over 1000 posts. If people were encouraged to discuss posts as well, I think it might get out of hand - although probably not as badly as the up/down convert threads.

 

Maybe we could have another LabVIEW sub-board called "LabVIEW Pitfalls to Avoid" or similar, where people are encouraged to post examples of bad code, and discuss how they might be improved. Off my head, topics might include examples of:

 

- Local variable abuse

- Globals variable abuse

- FGV abuse

- Obfuscated code

- Rube code

- Race conditions

- Misuse of the synchronisation palette


Yes...  There are many pitfalls..  Maybe like you said, we could have a sub forum. However, we would not want to give the idea that LabVIEW has pitfalls..  All programming languages do..  It's the programmers that create the pitfalls... 😉

 

Maybe a sub-forum called "Gatchas"...  LOL!  😄

0 Kudos
Message 270 of 396
(7,895 Views)