Wednesday, August 6, 2008

Documentation

Everyone knows that LabVIEW is self-documenting (wink, wink).

There's really no such thing as "self-documenting". When you write code and think it makes perfect obvious sense, you're delusional. There needs to be documentation with the code for it to be as readable as possible. In LabVIEW, this includes VI Info and liberal use of free labels on the diagram.

I guess in a way, this makes LabVIEW partially self-documenting. If you use the tools available to you, it's easy to make your VIs easier to understand. And it doesn't take that much more time to do than leaving your code undocumented. Beyond that, it will save you and your successor countless hours of figuring out "what does this code do?"

I sheepishly admit that in my first days of LabVIEW programming, I thought it would be easier to leave the documenting to the end of the project. After all, code changes so much throughout development, to document it right when you write it would be a waste of time.

This foolish attitude changed drastically and dramatically the first time my first boss made me go back through my whole project at the end and add VI Info to all my VIs. Even though this was only about a hundred VIs, it was painful and mind-numbingly boring. Imagine this on a large scale thousand-VI project! I am glad to have learned that lesson the hard way, but not too hard.

No comments: