Friday, November 09, 2007

Confessional Debugging

In Steve McConnell's "Code Complete", he describes a debugging (aka problem solving) technique called "Confessional Debugging". It goes a little something like this:

Talk to someone else about the problem. Some people call this "confessional debugging." You often discover your own error in the act of explaining it to another person. For example, if you were explaining the problem in the salary example, you might sound like this:

"Hey Jennifer. Have you got a minute; I'm having a problem. I've got this list of employee salaries that's supposed to be sorted but some names are out of order. They're sorted all right the second time I print them out but not the first. I checked to see if it was new names, but it didn't seem like it was because I tried some that worked. I know they should be sorted the first time I print them because the program sorts all the names as they're entered and again when they're saved ... wait a minute ... no, it doesn't sort them when they're entered. That's right. It only orders them roughly. Thanks Jennifer. You've been a big help."

Jennifer didn't say a word, and you solved your problem. This is typical, and is perhaps your most potent tool for solving the most difficult errors.



Non-geeks would call this "sharing" or even "theraphy" when taken to extremes. Here's a snippet of confessional debugging that I recently had.

(4:02:29 PM) redrobot5050: being self-aware doesn't make one less crazy
(4:02:33 PM) redrobot5050: often times, it makes you more crazy
(4:02:43 PM) redrobot5050: and realizing a problem and reacting to it like a mature, intelligent adult
(4:02:48 PM) redrobot5050: are separate issues
(4:03:02 PM) redrobot5050: i can understand after all that happened if [redacted] views part of me with ugliness
(4:03:54 PM) redrobot5050: anyway, i've kept you
(4:04:00 PM) redrobot5050: i just felt like clarifying for your own sake
(4:04:15 PM) redrobot5050: [redacted] is not a bad apple
(4:04:21 PM) redrobot5050: but [redacted], apparently
(4:11:19 PM) redrobot5050: anyway
(4:11:24 PM) redrobot5050: have fun whether or not you go or don't
(4:11:25 PM) redrobot5050: and take care

Labels: , , ,


Comments: Post a Comment

Links to this post:

Create a Link



<< Home

This page is powered by Blogger. Isn't yours?