BreakPoint

cancel
Showing results for 
Search instead for 
Did you mean: 

Why some people say Local Variables are bad...

If that was the case, why would someone want to "indicate"/"show" a value that is constant? 

I cheated and visited the thread.. I don't think the person was looking for Andy's solution..  😉

0 Kudos
Message 171 of 396
(7,915 Views)

Ray.R wrote:

If that was the case, why would someone want to "indicate"/"show" a value that is constant? 


 

It's like someone asking how to rebuild an automatic transmission, and the first answer simply shows a picture of a screwdriver. 😮
0 Kudos
Message 172 of 396
(7,897 Views)

altenbach wrote:

Ray.R wrote:

If that was the case, why would someone want to "indicate"/"show" a value that is constant? 


 

It's like someone asking how to rebuild an automatic transmission, and the first answer simply shows a picture of a screwdriver. 😮

As carl sagan once said, "If you wish to make an apple pie from scratch, you must first invent the universe"

Message 173 of 396
(7,870 Views)
Yeah how do you build an automatic transmisson, is there a VI, and what's a screwdriver....Smiley Very Happy
Regards
Ray Farmer
0 Kudos
Message 174 of 396
(7,819 Views)

Ray Farmer wrote:
Yeah how do you build an automatic transmisson, is there a VI, and what's a screwdriver....Smiley Very Happy

 

 
I thought this question might come up. Here's what you definitely need. 🙂 Cheers!
 
 
(I have two separate set of screwdrivers. One set for the right-handed screws and one for the left handed screws.)
 
Message 175 of 396
(7,795 Views)

I think this could be a Rube or Global Variable abuse 😮

 

 

Found in my old messy code that I'm in the process of rewriting from scratch (for this reason! 😄 )

Message 176 of 396
(7,766 Views)

Good catch. 

 

From this image, the only abuse is for not using a wire from the leftmost Local to the "Stop if True" terminal.

I recommend not using Locals or Globals because people usually abuse them.  In some cases it is okay to use them.

 

I wouldn't call it a Rube Goldberg.  It does not over complicate the code.  Unless there were things in the diagram that are not shown. Or the False Case is also empty ;).

 

Now without seeing the rest of the code, it is possible that the loop may run only once or may never end.  😉

0 Kudos
Message 177 of 396
(7,757 Views)

If Local Variables are so bad, why is this idea by Altenbach kicking so much ass? Smiley Happy (An idea that I helped spawn, BTW Smiley Wink) I guess if they were smaller, they'd suck less. Smiley Tongue

 

 

 

Message Edited by Broken Arrow on 03-26-2010 10:20 AM
Richard






0 Kudos
Message 178 of 396
(7,735 Views)

I like the idea of smaller footprints.  I'll chip in my 2 cents worth and say that local variables are not always bad.  I use them now and then.  The problem is that locals are misused so often, especially by Labview novice users and those that are switching from text based languages to graphical languages.  Its not that locals are bad, its the improper use of locals that is bad.

 

- tbob

Inventor of the WORM Global
Message 179 of 396
(7,721 Views)

tbob wrote:

The problem is that locals are misused so often, especially by Labview novice users and those that are switching from text based languages to graphical languages.  Its not that locals are bad, its the improper use of locals that is bad.

 


And avoiding the use of Locals or Globals does not make one an expert at LabVIEW.

 

RayR

 

aka: unCertifiedForeverNovice

Message 180 of 396
(7,709 Views)