April 27th, 2007

checking it for errors?

(no subject)

Pretty frequently, I read Raymond Chen's programming blog. He's good, if a bit too into picky internal Win32 details for my usual tastes. Something he said recently struck a chord with me: Let's assume we're lucky because, well, debugging is an exercise in optimism.

Yeah. It really is. I mean, you can prove pretty trivially that programs become exponentially more complex in their potential behavior (and misbehavior) as they get longer. In a small program you're searching for a needle in a haystack, and in a big program (say 50 thousand lines?) you're searching for a needle in a small galaxy.

But you come up with some silly approach that you figure might possibly solve it... And y'know, after one or two tries, or maybe after several hours of doing that, lo and behold, one of them does.

So debugging may be an exercise in optimism, but that makes it especially neat that it actually works most of the time.