BreakPoint

取消
显示结果 
搜索替代 
您的意思是: 

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

 

261 条消息(共 396 条)
8,280 次查看

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

0 项奖励
262 条消息(共 396 条)
8,264 次查看

@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 项奖励
263 条消息(共 396 条)
8,246 次查看

@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 项奖励
264 条消息(共 396 条)
8,222 次查看

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
265 条消息(共 396 条)
8,137 次查看

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 项奖励
266 条消息(共 396 条)
8,037 次查看

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 项奖励
267 条消息(共 396 条)
8,031 次查看

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 项奖励
268 条消息(共 396 条)
8,015 次查看

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 项奖励
269 条消息(共 396 条)
7,996 次查看

@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 项奖励
270 条消息(共 396 条)
7,993 次查看