Shauna's Blog

Debugging

Originally at http://www.shaunagm.net/blog/2011/04/debugging/

I’ve been tutoring a friend of a friend in Matlab, and we spent a good hour this afternoon chasing down a bug in his program. He asked how I can stand it, the constant trouble-shooting spiced up by the occasional epic search for a minor flaw*. “Doesn’t it drive you crazy?” he asked.

And no, it really doesn’t. I find programming to be deeply soothing. Even at its most frustrating moments - as I’m inventing new combinations of curse words, adding another obscenity each time an attempt fails - there’s this serene part of me that knows there’s an answer and I’ll find it eventually. It may take until the ocean is folded up and hung to dry**, but I’ll find it.

Many of my interests - psychology, history, politics - can’t promise me that. You set down to make an argument, conduct an experiment, analyze a primary source, and you can’t know whether you’ll even find an answer, let alone the right one. Sometimes you can’t even know that there is a right answer. I seem to be drawn, instinctively, to fields and questions where the most common answer is, “We just don’t know.”

So programming is a nice change of pace. Like cooking, I suppose, although more challenging (but not as tasty!) I’m kind of curious where other people fall with this - I know I have a lot of academically-focused friends who read this, do you find yourself craving an activity or two where you’re guaranteed to find the answer?

* Probably the most ridiculous bug-hunting story I have was when I spent hours trying to figure out what was “freezing” a program. I finally gave up, damned Ada Lovelace and Alan Turing, and went home. When I came into work the next morning with clear eyes, I realized that I’d accidentally told it to wait for 1000 seconds, not 1000 milliseconds, and so the program was not frozen but just waiting 16 and a half minutes before moving on.

** Those are W.H. Auden’s words, not mine.