Monday, April 26, 2010

Debugging made easier by giving up

Not giving up on debugging itself--oh, no, no, no... (Don't rule out strolling away from the problem for five minutes, though--that can often do wonders.)

I mean giving up your pet nail-problem-hammer-solution theory. And giving up the reflexive instinct to blame your code...or their code--whichever suits your mentality. And giving up--whenever you have the luxury--the notion that you have to fight alone. And giving up the habit of reflexively trying everything "solution" The Google sends your way.

(File permissions, on the other hand, are fair game for blame, as was demonstrated for me yet again tonight.)

The so-called "definition" of madness is doing the same thing over and over while expecting different results. In debugging terms, it's also the short road to madness itself. Don't get on that bus.

The irony is that, in code, there can often be one, maybe two, "optimal" ways of doing something; in debugging, it's all out on the table--maybe even some crazy stuff. That's one of the harder lessons to learn as a software developer, toggling between those two modes. But unless you prefer gremlin-chasing to doing useful stuff with code, it's the only way to roll.