Don't Fear the [Feature] Creeper?

Filed under: Articles — ewall at 09:02 AM on Mar 10, 2009
The past few days I've been tweaking some VBScripts for Active Directory and file monitoring on Windoze systems, and I've just about had it up to here. VBScript is so painful and inefficient! ( Tell me, what other language has a default error handling option of "On Error Resume Next" that you simply must use to get anything to work?!?)

This always starts and ends the same: At first, it seems like VBScript will be the easiest way to get the info. For example, the web has tons of sample code on how to query AD via VBScript that makes a good starting point. But then I start tweaking and realize that I want to pretty-print the output with simple options like sorting and filtering... and it just keeps getting more complicated, since VBScript doesn't do any of that easily. Now some of the scripts are over 150 lines long now, for doing the simplest things!

In the end, I always wish that I had used a "real" programming language to do them. And I will, eventually, I hope. But at the start it seemed like editing the VBScript would be easier.

In one case, I am writing a Nagios script in Python that will get info about Windows files via WMI, which can be run via winexe from a Linux box—this will be a major improvement over running Nagios-NT VBScripts. But my own perfectionism and tendency towards feature creep makes this an ever-lengthening process.

In another case—some simple scripts to list AD members and such—I just haven't found any good Active Directory modules for Python yet, so the obvious answer was to use the VBScript snippets I already had. (Okay, so maybe I wasn't trying hard enough to find a Pythonic solution, but my Googling did show that there were several competing modules and no one clear winner.) This one I just need to let go.

My writing teacher in college talked about how, at least for him, a poem he was writing was never "finished". I think I'm kind of that way with my small sysadmin scripts—I continue to compulsively "improve" them long after they have met the need. Sheesh.
Only logged in users are allowed to comment. register/log in