Here are the mistakes NI lists:
- Overusing Flat Sequence Structures
- Misusing Local Variables
- Ignoring Code Modularity
- Creating Massive Block Diagrams
- Disregarding the Need for Documentation
As I wrote last time, for the past couple months I've been working on a LabVIEW project. It's a high visibility test system that was originally built well over a decade ago and then went through an upgrade some years later. For several reasons it needed to be updated again. I have now wrapped up the major code rewrites, and once I resolve the remaining hardware issue I'll turn the system over to other engineers for debug work.
To be fair, the system worked. It's hard to fault the engineers whose work produced a functional test system of such complexity. Having said that, I need to add that the original code hit EVERY SINGLE ONE of the items on that NI list. In fact, I would add at least a couple more:
- Using GUI objects as data holders. Do NOT place a numeric control on the front panel, make it hidden, and then use it as a quasi-global variable. Just say no.
- Lack of knowledge about functional global variables. Oodles of information about them exists on the NI website, there are templates for them, and they don't break the dataflow paradigm. Just do it.