#givethanks 10

Today I’m grateful for software. Yeah, it was the backbone of my entire career– despite the fact that in college I had no intention of getting into software development– but that’s not why I’m grateful for it today.

A few days ago I was processing a bucketload of photos for a friend. There were about a hundred of them that needed to be cropped, resized, and then framed in a certain way. Although the process wasn’t difficult to do by hand, one photo at a time, a hundred of them were going to take around half an hour to process. So, I decided to write some software to do it for me. And that’s one of the reasons I love software: it’s like an infinite toolbox, from which you can fashion a tool to do almost anything you need.

The program I use to manipulate images has a built-in scripting language, and if I could write a script I could then run it against my hundred photos and within seconds I’d finish my little project. Moreover, in the future when I have to do the same thing for other photos, I could just pull up that script and whiz through it. The only real headwind here was that I didn’t actually know the language! In a general sense, all programming languages are the same, and it’s just a matter of semantics. They solve the same kinds of problems in the same kinds of ways, but you have to know the syntax so you can structure a program in the right way. By all accounts I’m a pretty decent programmer, and I know about half a dozen languages fluently, and maybe another half-dozen at a high level. This one, however, was completely new to me.

So I sat down and started digging through the documentation about the language. I learned how variables are set, commands executed, and loops looped. Then I had to learn the API– the application programming interface– so I could use the language to do what I needed on my photos. That was another set of documentation. Finally I started writing my script. I tested it. I tweaked it. I tested it again. This is the way of software development.

The thirty minutes I would’ve spent processing the photos by hand soon became three hours of reading, writing, and testing. For some reason, the script just wouldn’t do what I wanted. Eventually I decided it was simply going to take too much effort for too little return (meaning I wasn’t sure how often I’d actually use this scripting language in the future). I heaved a heavy sigh, closed my editor window, and processed the images by hand.

Larry Wall, inventor of the Perl programming language back in the 90’s, was famous for stating the Three Great Virtues of a Programmer:

Laziness: The quality that makes you go to great effort to reduce overall energy expenditure. It translates into labor-saving programs that might take some time to create, but that, over time, will save far more time.

Impatience: The anger you feel when the computer is being lazy. It translates into ways to make the computer, and thus yourself, more efficient.

Hubris: The urge to write software so other people don’t say bad things about it. It translates into a pride of craftsmanship, writing a program that works well, handles errors gracefully, and is easy to maintain.

I’ve definitely felt all three of these Virtues in my thirty-odd years of software development. And even though I’m not writing software for clients, or working on a team with other people who have to understand what I’ve written, I find myself writing scripts and programs literally every week. Thank goodness for software.