LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Prefix namespacing should go the way of 8.3 filenames? Your opinion Please

In the "The Xylophone Project IV - Core Architecture " thread Dr Damien wrote

 


 ...

 

 

The last project I started with new code was in prerelease 8.0.  It had the distinction of being the first shipping large application ever designed with the LabVIEW project and LabVOOP.  But wait, you say, LabVOOP did not ship until 8.20.  Correct.  I had to re-engineer with libraries.  It was then I found out that most use of prefixes was unnecessary.  In fact, the separate namespacing nature of libraries/objects greatly simplifies the creation of plug-in architectures.  So, long-winded answer to a short question, I think that prefix namespacing should go the way of 8.3 filenames. [emphesis added]

...


 

after Ray Farmer posted

 


 

I am reading 'Clean Code' - Robert C Martin at the moment and in there it suggest that any prefix to names is not required these days, but I was wondering if its still essential with LabVIEW but as Ben points out maybe its not.


Well of course I am brining this topic up since I think it is a standard that should be dropped.

 

Please voice your thoughts on this topic and if we can come to some agreement, we'll re-write the LabVIEW Style guide.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 1 of 4
(3,809 Views)

Until LV 7.1.1 we used namespacing prefix for each module. Each module was divided into two folders named "Interface" and "Implementation".

In our first LV 8.0 project we just took over the folders on disk into virtual folders in the project.

All refactored (new written) software is using LabVIEW libraries and do not need namespacing prefix.

 

We even forgot the namespace prefix earlier than we learned to use them.

Message Edited by waldemar.hersacher on 03-12-2009 01:41 PM
Waldemar

Using 7.1.1, 8.5.1, 8.6.1, 2009 on XP and RT
Don't forget to give Kudos to good answers and/or questions
Message 2 of 4
(3,788 Views)

Very good point, Ben. I was under the (probably mistaken) impression that you still had to do prefixing even with LabVIEW 8.x. But perhaps I haven't really looked at this in any level of detail. I would need to see what impact trying to use libraries would have on the code I have for the various projects I've done, especially since I don't use LVOOP (don't get me started on that). The VIs I write for functional groups have the functional group name as a prefix, but I also typically have a "Support" subdirectory for subVIs used by these "top-level" VIs. The name scheme I use in this case is "<functional group> - Support - <VI name>".

 

It's worth looking into, but I can't really offer an opinion one way or the other until looking at it further. 

0 Kudos
Message 3 of 4
(3,768 Views)

I spent a little time with this taking the one main project and converting directories to libraries and whatnot. I do see a problem with this approach: sublibraries. I started with my "Utilities" directory. Within there I had a bunch of folder for each category: "Array", "Numeric", "File", etc. So I created a library for each subgroup: "Array.lvlib", etc. I then created a "Utilities" library and placed each individual sublibrary in that and saved all of that. Now, after I close everything and open, say, "Array.lvlib" it automatically opens "Utilities.lvlib" with everything loaded. Worse: let's say I just need the Array library and I copy that over to another computer. If I open Array.lvlib on the other machine everything seems OK. But, if I open one of the subVIs it has a broken arrow because "Utilities.lvlib" is missing.

 

I know this is all by design, but in my book this makes it quite restrictive, and for the moment I'm going to stick with prefixes since I can copy over the "Array" directory and not have a bunch of broken VIs. Too bad, though. 

 

ADDENDUM: Yes, I know I can "Disconnect from Library", but this is extra work that would be required for each library that I decide I need on the other computer. 

Message Edited by smercurio_fc on 03-12-2009 04:41 PM
Message 4 of 4
(3,742 Views)