8.1 Why Do We Need Standards Anyway?

   

Why do we need standards? The simple answer is that your source code is how you communicate your design. Any technique you use to improve this communication has to be worthwhile.

Somebody, usually under severe pressure, will pick up your project with maintenance in mind. Will they curse you or kiss you? If you have commonly enforced standards within your team you'll find that life will become easier, sharing will become more natural, maintenance will be easier, and productivity will improve. In essence, pick a style that you and your colleagues are happy with, formalize it, and stick to it.

A good starting point for this information is in the LabVIEW Development Guidelines, which are part of the LabVIEW online documentation.

This section will describe some commonsense standards that we have found helpful, and it will also showcase some of the bad practices and pure laziness that we have come across in our own journey.

Experience the horror of opening a block diagram such as that presented in Figure 8.1.

Figure 8.1. Bleaaaaargh!

graphics/08fig01.gif

We enjoy having to walk the mouse the equivalent of 10 miles to find the boundaries of the diagram as much as the next developer, but this is just a pain! It must be more difficult to write programs like this. Diagrams like this communicate a great deal about the perpetrator ”that they are an ignorant fool is just one.

Rule 1 then:

WHITE SPACE IS EVIL, DESTROY NEARLY ALL OF IT.

A front panel like the one shown in Figure 8.2 usually accompanies the previous diagram.

Figure 8.2. Bleaaaaargh! Part 2.

graphics/08fig02.gif

Rather than actually spend the 20 seconds tidying this up, let's sprinkle controls and indicators liberally over the front panel. It is hard to believe that there isn't enough time to select the controls and then align them.

At the other end of the spectrum is the diagram shown in Figure 8.3.

Figure 8.3. I can't see the wood for the trees.

graphics/08fig03.jpg

One of the advantages of LabVIEW is that the block diagram helps to communicate the design. This diagram fails to convey much because you overdose on information. We call it cramming, where you try to stuff as much as possible onto the page.

 Itseffectsareabitlikethismakingitverydifficulttoseewhatsgoingon. 

   
Top


A Software Engineering Approach to LabVIEW
A Software Engineering Approach to LabVIEW
ISBN: 0130093653
EAN: 2147483647
Year: 2003
Pages: 66

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net