Why admins should know how to code

You don't need to be a programmer, but you'll solve harder problems faster if you can write your own code

We've all been on the receiving end of that essentially unanswerable question, "What do you do?" I usually answer, "I work in computers," just to see where the questioner's mental association goes. I often get responses like, "Oh, you make websites?" or "Oh, you mean like you are a programmer?" or the dreaded "Oh really? Can you fix my laptop? It's been doing this strange thing where blah blah blah."

Strictly speaking, I have written many Web applications, but I'm not necessarily a Web developer. I've written hundreds of thousands of lines of code over the years, but I don't consider myself a programmer. My answer to that programmer question is usually, "I develop elegant solutions to difficult problems." That's the most accurate portrayal of what I do day to day without getting mired in specifics that would be lost on most folks.

[ Also on InfoWorld: 6 things every IT person should know | Get practical IT advice and insight with Matt Prigge's Information Overload blog. | Get the latest on data center hardware and software with InfoWorld's Data Center newsletter. ]

The fact is, while we may know several programming languages to varying degrees, most IT ninjas aren't developers, per se. I've put in weeks and months of work on various large coding projects, but that's certainly not how I spend most of my time. Frankly, I don't think I could just write code day in and day out, but when I need to develop a tool to deal with a random problem, I dive right in. I can sense my brain reorganizing to fit the language I'm using to write that tool. It's a bit eerie.

Tools of the trade

Bottom line: Admins need to be at least passable with some sort of scripting language for their chosen platform; ideally, they should be familiar with several. They may be VB and PowerShell on Windows or Bash and Perl on *nix. These are the pathways that open up all kinds of possibilities for problem resolution and the aforementioned elegant solutions. Not that you're going to embark on massive projects running into tens of thousands of lines (though that can happen) -- most of the programs you write will be surprisingly short.

I did a quick check on a network monitoring server I've been maintaining for a while now and calculated just the Perl scripts that I've written to support various services and packages on that box, from Nagios to Cacti and back again. It came out to around 15,000 lines of code across 53 scripts. That's an average of 283 lines of code per script. Further inspection showed that three scripts alone accounted for more than 5,000 lines, skewing the average. There were a dozen scripts that were only 30 to 40 lines. This is the nature of IT admin coding: crafting small, critical tools that hold everything else together.

Take, for instance, a set of Perl scripts I wrote eons ago, when there was no good way to track FLEXlm licensing across an enterprise. This was well before there were any third-party monitoring tools for FLEXlm, and the commercial license monitoring apps weren't cutting it.

1 2 Page 1
Page 1 of 2