LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Why does LabVIEW allow me to have 2 controls with same name

Isn't that a bit hippocritical? Replace the word "computer" with "human" and you'll see what I mean.  I don't see the harm in having disallow as an *option*
Message Edited by SiegeX on 12-12-2008 12:44 PM

Message 31 of 33
(1,058 Views)

I agree with SiegeX.  The disallow mode is an option, and users can choose to have the warning option selected.  The only valid reason I see for even allowing it in the future as an option is that it might break legacy code.

 

From a programming language design perspective, this should have been disallowed in the first place.  Control names are what somebody reading the code sees (for instance when he is looking at a property node, or a local variable, or even a terminal).  He shouldn't have to look at code that writes to "Control A" and then go and do a "Find Control" to see which "Control A" is being written to.  Imagine doing this for every place in the code where somebody writes to a control.  It is also unreasonable for a programmer to know the names of all the controls on the front panel of the application and to know which of those have duplicate controls with the same names.

 

To the guy who said that he doesn't like it when a computer tells him what to do, or forces him to do things a certain way: I get irritated too when Microsoft Word sometimes insists that I write a particular way or automatically resizes my tables on page 1 when I make an edit to a line on page 20.  However, in certain cases, computer enforced discipline is justified.  For instance, in C, you cannot declare 2 variables with the same name within the same function.  There is a reason for this.

 

S G
Certified LabVIEW Architect, Certified TestStand Architect, Certified Professional Instructor
0 Kudos
Message 32 of 33
(1,037 Views)


To the guy who said that he doesn't like it when a computer tells him what to do, or forces him to do things a certain way: I get irritated too when Microsoft Word sometimes insists that I write a particular way or automatically resizes my tables on page 1 when I make an edit to a line on page 20.  However, in certain cases, computer enforced discipline is justified.  For instance, in C, you cannot declare 2 variables with the same name within the same function.  There is a reason for this.

 


 Yes, I'm not saying I mind that as an option.  But just like I mind Word enabling auto-correct by default, I can imagine some users would dislike having older code broken by default.  Of course, it is considered poor style, so you don't want to ignore it by default either.  This is why I think warnings would be a good default behaviour.

0 Kudos
Message 33 of 33
(1,030 Views)