LAVA 1.0 Content Posted August 23, 2006 Report Share Posted August 23, 2006 I suggest common naming standard for class initialization methods as long as LVOOP doesn't provide special initialization methods. There is a strong need for common naming so that class users easily know which method to call to initialize an object. The name of the initialization method needs to be different for each method in any class hierarchy because LV doesn't allow overriding the method connector pane. Therefore I suggest that all initialization methods should have the name of the class. That is for ClassA the default initialization methods should be called ClassA.vi. If class needs destructor, it should be called ~ClassA.vi following the naming in C++. "~" can be part of file name at least in LV 8.2 on Windows XP, can anybody verify that this also works on Linux and OS X. If there are more than one alternative initialization method for the class I suggest that the default one should be called as described above. The succeeding ones should be called ClassA.1.vi, ClassA.2.vi, .... that is adding the period and the number of the initialization method. The numbering starts from 1, the default method can be considered as the zeroth one. How does this sound to you? Quote Link to comment
crelf Posted August 23, 2006 Report Share Posted August 23, 2006 How does this sound to you? I don't agree - although several models for naming have been suggested in the past (eg: the VIE naming model), all of them have been met with luke warm acceptance. Are you suggesting the we all just get together and use a convention, or that LabVIEW forces you to use a convention. Either way, I'm against it. If you want to implement a standard anming convention in your own company then go for it, but I don't think it's appropriate to try to force others to use it. Quote Link to comment
LAVA 1.0 Content Posted August 23, 2006 Author Report Share Posted August 23, 2006 Are you suggesting the we all just get together and use a convention, or that LabVIEW forces you to use a convention. LabVIEW doesn't force convention, as you all know. It would extremely help class user if there was a common naming convention for initialization methods. It would also reduce bugs, as class users could easily verify if such a initialization method exists. On the other hand if initialization method name varies from one class to another, it is very easy not to know if some method should be called to initialize an object. Consider how much it easies your life that all programs have the same name and place for the operation that stores your current work to disk. On Windows computers it is File -> Save or Ctrl + S. It's a little same thing here. Either way, I'm against it. May I ask why? Don't you see any good in common naming convention? Quote Link to comment
crelf Posted August 23, 2006 Report Share Posted August 23, 2006 On the other hand if initialization method name varies from one class to another, it is very easy not to know if some method should be called to initialize an object. Sure - that may be so within a company or a particular engineering department, but applying a code naming convention across the industry is completely different. Consider how much it easies your life that all programs have the same name and place for the operation that stores your current work to disk. On Windows computers it is File -> Save or Ctrl + S. It's a little same thing here. Apples and Oragnes - you're talking about a software useability feature at the user level, I'm talking about a programming nomeclature at the programmer level - completely different. May I ask why? Don't you see any good in common naming convention? I sure do, but only in a smaller context, as described above. For example, I don't think it's a good idea that we name all strictly type-def'd controls as "STDEF - name.ctl" - that might be fine in a particular project, or paritcular team, or particulay company, but I find it far too limiting to try to apply that to an industry. Quote Link to comment
LAVA 1.0 Content Posted August 23, 2006 Author Report Share Posted August 23, 2006 Sure - that may be so within a company or a particular engineering department, but applying a code naming convention across the industry is completely different. You are so right. You never know if the marketing department wants to call your class contructor ClassA.20.vi to celebrate the 20th anniversary of your product Quote Link to comment
Jim Kring Posted August 23, 2006 Report Share Posted August 23, 2006 You are so right. You never know if the marketing department wants to call your class contructor ClassA.20.vi to celebrate the 20th anniversary of your product Actually, I heard that the .20 idea came down from the very Top of NI ;-) Quote Link to comment
crelf Posted August 23, 2006 Report Share Posted August 23, 2006 Actually, I heard that the .20 idea came down from the very Top of NI ;-) Geez Jim - can you make it anymore obvious?!? "What you talkin' about, fool?" with a Phd... Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.