Friday, July 17, 2009

The Diagram Cleanup Experiment

For many years now, I've taken pride in the appearance of my LabVIEW diagrams. One of my first tasks when I joined LabVIEW R&D several years ago was to rewrite the LabVIEW Style Guide, and more recently, I was very much involved in the reviews of Peter Blume's The LabVIEW Style Book. I cannot claim style perfection, but I can say that you would have to search pretty hard in all the code I've written over the years to find backwards wires, overlapping objects, uncommented code, or any other style transgressions.

However, that clean code doesn't come without a cost...a cost of time. It takes time to perfectly align objects, to minimize space to achieve optimal compactness, to align control terminals on the left and indicator terminals on the right. My kindred spirits in LabVIEW style know what I'm talking about here.

Speaking of time...for the past year, I've been enjoying how much time I've been saving with Quick Drop. I can safely say that the most constrictive bottleneck on my LabVIEW programming speed--palette navigation--is no longer an issue. But seeing as I'm always looking for ways to write more code in less time (which translates into more features for you!), I very quickly became aware of the next biggest bottleneck--clean diagram arrangement.

So I'm going to embark on a journey with LabVIEW which is undoubtedly fraught with peril, but should ultimately benefit all LabVIEW users. I am going to throw my current method of incremental diagram arrangement out the window, and rely 100% on Diagram Cleanup to do the job for me. The way I see it, we've got a feature here that is supposed to give us clean diagrams. It's also going to have some pretty nice improvements in LabVIEW 2009. So instead of ignoring this great feature that has tons of potential, I'm going to use it, recognize its shortcomings, experiment with its customizable settings, and file CARs to make it better. I envision a day, hopefully not too far off in the future, where we can spend our programming time focusing entirely on programming, and not being distracted by aesthetics.


  1. Darren, I am a big fan of this feature. More so than the quick drop. :-) I think it's a powerful tool but unfortunately it breaks down on larger diagrams and has some quirks that leave you scratching your head and wondering: "don't they know that that's wrong?"

    I've tried some of the enhancements in LabVIEW 2009, but I haven't put it through the paces. There are still some tweaks that need to be done in my opinion that will help bring it up to the level that pros like us will be comfortable with.

    In any case, I believe that this is a feature that will take years to perfect and I hope NI is in there for the lang haul because it's far from done. I too will be submitting my reports and requests to NI on this one...

  2. I agree that it's good that someone within R&D will be dogfooding and really putting this feature through its paces. I also think this is a great feature (although I still don't use it most of the time, due to its current shortcomings) and having someone commited to finding and reporting the kinks should hopefully bring it to a state where it's usable 90% of the time (or more, hopefully).

  3. I have been a LabVIEW programmer since LV 1.2 in 1989. Every new version, I try out some new features and turn them off because they just don't work the way I want them to. "Cleanup" has been one of them.
    I have my ideas of style and neatness and organization and expecting the machine to "think" like I do has always been an exercise in frustration (I don't like automatic transmissions, either :-).
    Unfortunately, I have learned to not give it very much time. I just cannot spend the time figuring out the tool, and bending it to fit what I need, so the preferences switch gets hit pretty quickly.

    Maybe you can remedy that - if so, kudos to you, and I'll be watching.

  4. Will there be a demo of the new features in diagram cleanup in any of NI Week's presentations, like last time? Will it be posted online?

  5. I imagine the What's New in LabVIEW hands-on presentation (at 10:30 AM each day of NI Week) will cover these new features. And I'll probably discuss this feature eventually in a nugget.