Sharp Blue: Reflections on the hunting of bugs


About This Article

comments feed

Tips Jar

Paypal Pixel


Software engineering is essentially too hard for humans to do. Almost all the advances in the field (from subroutines through to aspects by way of such advances as objects and patterns) have stemmed from understanding this fact - they are psychological rather than technological innovations. It’s always dangerous to assume that you’re smart while programming, because your brain might’ve evolved to make you think you’re smart but it certainly hasn’t evolved to write computer code. The great programmer Dijkstra was fond of saying that one of the greatest virtues in a programmer is humility - if you assume you’re no good then you won’t trip over your own delusions.

The most constant reminder of one’s inadequacy in the face of software complexity comes in the hunting of bugs. Anybody who’s ever programmed is familiar with the feeling you get when you finally find one of your bugs. It isn’t “I was clever but not clever enough!” but rather “How could I be so stupid?” This is a good feeling, because it reminds you to work from a position of humility - if you’re such an idiot that you make stupid mistakes then it’s probably a good idea to design your code so it’s not too sophisticated. (In the rare cases in which you think a bug was subtle rather than being an obvious flaw masked by your own idiocy, it’s probably time to rethink the program because if there’s room for flaws that are subtle even after they’ve been discovered then the structure of your program isn’t clear enough.)

All of the above were reflections induced by my having just spent an hour trying to find why some code was working from the command line but not in a browser. It turned out that I’d made the most elementary possible error - the permissions on the script were set incorrectly.

I am an idiot, but at least I don’t often forget it!

Leave a comment