Distance Debugging Logo

One of the qualities that I look for in other developers to signal that they have the requisite experience is what I call "Healthy Cynicism". Programmers fresh from school, or who have only been given token work in the past have an attitude that says, "Things will work out". That's a great attitude to have when you are building something new, but it's counterproductive when you need to debug something. Debugging is about expecting the worst. I have a lot of conversations with people that go like this:

Me: "So if the user decides to minimize and then maximize the window in the three seconds while the application is loading, the system will segfault."

Cheery Programmer: "Will that ever happen?"

Me: "I'm reading to you from the bug report database"

Certainly cynicism can get out of hand, and lead to a situation where a group becomes mired in inaction because everything seems likely to result in failure. The attitude of a Healthy Cynic is not that failure is inevitable, but that any misuse of the system you can think of will probably be done, and any bad system state you can imagine will be entered at some point. The Healthy Cynic says, let's be serious about what bad things can go wrong and make sure our system can handle them.

In debugging, the attitude is invaluable. As I've alluded to before, part of the success in debugging is simply accepting that a bug exists in the first place. For example, I see replication as much about being able to prove you fixed the bug as it is about proving the bug exists. A Healthy Cynic looks at a bug and says, yeah, that could probably happen and has a jump on others who are still trying to explain the bug away. A Healthy Cynic also assumes that users are mostly stumbling through your application and will do ridiculous things with it. It would be nice if they didn't, but pretending that they will stay on your nice rutted paths is a recipe for disaster.

This combination of considering worst-case scenarios and then trying to build a system which anticipates and handles them, and treating bugs as real and likely right from the start is what makes Healthy Cynicism a core debugging skill. Unfortunately, it's not enough without an offsetting force. Tomorrow's post will discuss the flip side, Healthy Skepticism.