BreakPoint

cancel
Showing results for 
Search instead for 
Did you mean: 

Why some people say Local Variables are bad...

 

Still needs some work...

Message 91 of 396
(11,014 Views)

Below is part of the Locals abuse...

 

Abusing Local Variables by using them as container of data or to change the data values can lead to race conditions.  It is not necessary to use Locals to change the value of a variable, since the variable is the wire itself.  It is better to chage the value to the wire and use a state machine to update the display of the value.  Only this portion of the code was  shown, but looking at the entire code makes it difficult to understand the intent of the coder.  So in this perspective, abusing Locals makes it difficulr to read and unsderstand the code.

 

found here:  http://forums.ni.com/ni/board/message?board.id=170&view=by_date_ascending&message.id=401019#M401019

 

Message Edited by Ray.R on 04-12-2009 08:14 PM
Message Edited by Ray.R on 04-12-2009 08:19 PM
Message 92 of 396
(10,896 Views)

From: http://forums.ni.com/ni/board/message?board.id=170&thread.id=411529

 

Quoting smercurio: "Your code suffers from the dual-condition we here like to call "sequencitis" and "local variablitis". Text-based programmers would absolutely love your code. LabVIEW programmers, on the other hand, would have a heart attack."

 

Message 93 of 396
(10,728 Views)

Ray,

 

Based on the use of the large words in the diagnosis, I believe its now 'Dr. smercurio'.  Wonder what his bill is going to look like?

Message 94 of 396
(10,728 Views)
It won't be cheap... Because he's a Specialist, and not a General Practitioner..  😉
Message 95 of 396
(10,728 Views)

The first identification of this pandemic was reported over two years ago. Still, there is no vaccine in sight 😞

 

Exessive contact with text based code if often considered a mitigating factor.

Abstinence from text based code and large doses of vitamin G are the only known remedies.

It is somewhat contageous and quaratine in a suitable LabVIEW forum is strongly advised.

 

😄

Message 96 of 396
(10,714 Views)

Here is a small slice of a big problem found here.  http://forums.ni.com/ni/board/message?board.id=170&thread.id=414838

 

 

 

 

Message Edited by Wayne.C on 06-09-2009 08:18 AM
0 Kudos
Message 97 of 396
(10,577 Views)

It is allowed to run a wire from one frame of a flat sequence to the next frame (or anywhere outside the frame).  It is not necessary to use Local Variables.

 

Message 98 of 396
(10,560 Views)

Ray.R wrote:

It is allowed to run a wire from one frame of a flat sequence to the next frame (or anywhere outside the frame).  It is not necessary to use Local Variables.


A more serious issue is the fact that there are three pairs of controls having the same name. Looking at the image, there is no way to tell if the second frame ever gets any new data. 😄

 

I am also puzzled with using comparison operations on strings. That sounds like a minefield to me. 😮

Message 99 of 396
(10,554 Views)
That's a good name for Locals.... minefields..  😉
Message 100 of 396
(10,540 Views)