Showing posts with label Diversions. Show all posts
Showing posts with label Diversions. Show all posts

Thursday, December 18, 2008

Tinkering

Around this time of year, things seem to slow down. Or else they speed up. Nobody's around at work, but the ones who are there want their systems running NOW!

This leads to the dreaded schedule pressure. Every five minutes you have an email or a phone call or a personal visit from your favorite customer asking, "are you done yet?" It's like the quintessential child in the back seat of the station wagon on the road trip. No matter how many times they ask, it won't be done quicker. Actually when the customer's harassing you for the LabVIEW code, it's worse than the car ride. They slow you down with their distractions.

In addition to that, there's always this desire to tinker. Whenever faced with important tasks, due ASAP, it is easy to fall into a comfortable trap of tinkering.

So what do I mean when I say, "tinkering"? I mean messing with non-essential code. Straightening, rearranging, questioning stuff that works, and so on. Consider an example:

OK, Alarms and Shutdowns need to be ready yesterday. Better finish up that adaptation of the old code. You know, I always wished it was a little more direct here. And I think that I could improve the readability of that section of logic. Oh, look at that crooked wire and redundant shift register.

All that is tinkering. It doesn't contribute to the deliverable in a way that benefits the customer. But it is so damn tempting! Especially when everyone else is standing around chatting all day about vacations and holidays and stuff, the tinkering is so tempting. It reminds me of college, where I had my engineering finals while all the Sociology majors went to bars and parties night after night.

In college, you could go to the parties and study a little and still get a decent grade sometimes. But in life, you often must put your head down, and take care of business to get it done. And in the end, it isn't as bad as it seems.

In these urgent times, even though the urgency is occasionally artificial, if you're to meet your business objectives, it's best to avoid tinkering and stick to the most important functional features.

Sunday, October 5, 2008

Refactoring Code

Last time I wrote a bit about huge projects. I glossed over it a bit.

Truth is, many big projects aren't fully or adequately spec'd out at the start, and come crunch time...let's just say that compromises are made.

So often you can look back at code and wonder who made that terrible design decision or atrocious wire layout. Why did this guy document his code so poorly? What the heck does that VI name mean? This page-long diagram could have been done with three nodes! And the list of criticisms goes on. Until you realize you're the one that wrote that VI.

Every now and then you get a great chance to rework an old peice of less-than-optimal code. I am fortunate enough right now to have that times two. I have the big project that's just about almost got the complete confidence of the customer. In the mean time, there's the immediate follow-on from the big project, which is a clone of the first with enhancements. At the same time, there's a separate project for a different group in the same company that intends to leverage a large part of the original big project.

This means that I'm making additions to the main project at the same time as borrowing sub VIs for another project. It's a really eye-opening opportunity. When you delete all but a dozen nodes from a ten-state state machine VI to replicate the functionality of that VI in another project, you really start to wonder about the tradeoff between overhead and flexibility.

Thursday, October 2, 2008

Little Projects

Most of the time we get to work on massive projects. The sorts of things where you spend weeks or even months in meetings at the start of the thing to try to figure out what exactly it is the program's supposed to do.

These are great fun. You get to come up with a few grand new ideas to incorporate into your standard approach and architecture. And then you get to do it. And in the end, you have this big thing that you contributed in large part to that does something significant.

At the other end of the spectrum, you sometimes get these little one day jobs. Just a simple data logger or temperature controller. These are really fun in their own way, too. There's something to be said for sitting in front of a blank VI at 9AM and walking away from a screen full of graphs and a disk full of data files at 5PM. Just an hour's worth of defining requirements and a few hours of coding and a few hours of touch-up and you're done.

It speaks to the power of LabVIEW that you can perform both of the above tasks with the same environment.