April 08, 2009

Longevity and Focus

I've been knee deep in Excel macros and VBScript for a day or so. A big spreadsheet project for a client, loaded with automation and scripting. I put this together originally back in 2004, and made some big changes in 2006 or so. Now it's time for another go around.

It's kind of interesting to be digging up the past like this. First off, I've been procrastinating on this, mainly because I'm resurrecting 3-5 year old programming skills that I honestly need to retrain myself on. Second, I've never been a particularly careful programmer (it's not my core competency, just something I am naturally pretty good at) so I have not done a good job of documentation and organization - it's kind of like a rambling estate that started off as a two room shack. And lastly, this particular project was not really intended to become a permanent tool - just something I cobbled together for my own purposes (I was assisting them in testing and evaluating the original device, back in the day) that grew into a customer tool / feature. I always envisioned a more permanent, hard coded application (not Excel based) being developed from this, but the product has hovered in an odd limbo - not successful enough to warrant a full rework, but successful enough to be maintained and continued.

It's a spreadsheet for importing, viewing and using (exporting charts and waveforms to other applications) the data from an embedded power monitor. It started off simply in 2004 - a log of sampled RMS voltages, and captured waveforms for specific voltage events. In 2006 or so, they added some features - Min / Max measurements for the voltage monitoring. And now, a more extensive product improvement - adding three channels of current monitoring (RMS measurements and waveforms), adding environmental monitoring (temperature and humidity), and adding calculated KVA (from the RMS voltage and current measurements). So the spreadsheet revision is quite extensive.

I spent a bunch of hours yesterday just going through the old code - cataloging all the macros and code to reteach myself as well as to create a reference document (for the client's use as well as my own use). I can already see at least one redundancy that I think I can streamline. It's also a bit complicated in that the spreadsheet, if left to its own devices, balloons to over 25 Meg (the data sets are very large, and Excel is a bit of a memory hog)- so there is an entire set of code dedicated to emptying the spreadsheet and deleting 1000's of rows of data upon closure, and repopulating things upon opening, to get it down to a more reasonable 5-6 Meg.

I tend to get a little fixated when I am working on a project like this - I'll sit for hours, losing track of time, creature comforts, etc. I work through meals, and late into the evening - I email myself the latest version and put in some hours at home, I show up at the office early to get a few hours in before yoga. There is a bliss in that level of single-minded concentration and focus. Now that I am so deeply into yoga and meditation, into my enlightenment experiences, I can recognize a certain preciousness in being so engaged in an activity as to lose myself .

So, if I have a glazed stare the next few days, I am writing code in my head. I'll return to the and of the living anon.

No comments: