BreakPoint

cancel
Showing results for 
Search instead for 
Did you mean: 

Why some people say Local Variables are bad...

Classic!


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

@JÞB wrote:

Classic!


I wonder what's the purpose of the nearby inner FOR loop. It just updates the same locals twice with the values of their own associated controls, nanoseconds apart. Short circuit!

 

(What's up with that "write value of control to it's own local variable" stuff. Seen that several time in the last few days. Must be some literal translation of text based code.....)

0 Kudos
Message 372 of 396
(8,888 Views)

The title should tell you more than enough...Local variables and clusters


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 373 of 396
(8,787 Views)

I beleve this one is trying to collect them all.

locals to jump between stap in frames ( that is not requird if wire's were used ) ( and a nice rb in the deal to )

using locals that are next to the unused icon, a race condition that can be prevented by just using a wire.

he is almost there. he is going te get them all.


Learning LabVIEW since January 2013
Message 374 of 396
(8,709 Views)

A fine example spotted by Altenbach:  (seen here)

 

 

0 Kudos
Message 375 of 396
(8,485 Views)

@Ray.R wrote:

A fine example spotted by Altenbach:  (seen here)


Correct link to source is here. Also being discussed in the RG thread here.

0 Kudos
Message 376 of 396
(8,512 Views)

@Ray.R wrote:

A fine example spotted by Altenbach:  (seen here)

 

 


Ah automated race condition detection!  Sweet!


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

Another serious abuse of Locals...  and potentially race conditions...  lots of 'em.

Discussed in Rube Goldberg code  here and discussion thread  here:

 

0 Kudos
Message 378 of 396
(8,415 Views)

I recently was tested on my LabVIEW skills or lack of it at an interview.

The solution to the problem required use of a local variable.

It was the first question.

I failed the question and the interview.

0 Kudos
Message 379 of 396
(8,379 Views)

@nyc_(is_out_of_here) wrote:

I recently was tested on my LabVIEW skills or lack of it at an interview.

The solution to the problem required use of a local variable.

It was the first question.

I failed the question and the interview.


Well, that's why we have certification. Companies should rely on that instead of cooking up their own obstacle course. 😮

 

And yes, local variables have their purpose, mostly in UI related code. I use them all the time! 😄

 

Nothing "requires" the use of a local variable. There are always alternative solutions... 🙂 But local variables are sometimes the best solution (e.g. over the use of value properties).

0 Kudos
Message 380 of 396
(8,377 Views)