Code smells are.. well.. whenever I notice those, I get sceptical about the quality of your(my!) work. It doesn’t mean that you don’t have a perfectly valid reason to use those .. artifacts, but I might talk to you when reviewing code
So, code Smell #1: Code > 1 page
Birgit, does LabVIEW have a zoom?
That question never fails to make me chuckle, because I associate it with many, many conversations pointing people towards better code. The answer: No, it doesn’t have a built-in zoom.
Did you notice the word built-in? Yeah, people notice that. I’ll tell you how to really zoom – if you consider my little suggestion: Don’t build software where you need to use a zoom. I’ll excuse a large monitor, possibly two normal sized ones for applications with many complicated, GUI elements that are hard to reference, but .. just don’t.
SubVIs are dead easy to create. Just look at your code, and select a piece that should be turned into a subvi:
(I even started an english copy of LV for this.)
Instant subvi. More space, more readability!
Don’t forget to open your subvi, give the inputs and outputs decent names (it automatically takes the wire names, if you use that great invention by NI, btw), and replace the standard icon with something readable.
These are not perfect (For example, I don’t like their connection pattern choice), but it’s such an awesome feature for fast refactoring.
Still need that zoom?
Go buy a Microsoft Intellipoint Mouse (it has to be Intellipoint for some reason) and link the middle scroll wheel with the Windows zoom function (within LabVIEW). Now you can magically zoom in LabVIEW and impress your coworkers.
But I want you to feel bad about your messy giant pile of spaghetti.
Really, really, really bad.
(Next part in the series: Think Dataflow!)