You Want Me to Talk to an Inanimate Object. Really?

One of the emails I receive daily has a ‘Geek Trivia’ question.  The site is: if you want to check it out.  I find the questions always interesting even when I get the answer wrong.  Today’s question asked for the name of the trick in programming where you debug your code by explaining your code to an inanimate object.

The correct answer was Rubber Duck Debugging.  Honestly I’ve never heard the term before.  Basically, it requires you to take a moment after finishing your coding to explain your code out loud line by line to an inanimate object. (The article does not say whether this occurs at the end of a module, project, or solution, but I’m thinking that the more often the better because even a rubber duck has its limits on boredom.)

As silly as that may seem, I realized that this technique has at least a grain or two of truth.  Back when I did more programming, (some may say that was back in the days of 2-character BASIC variable names), explaining how my code worked to someone else often revealed something I missed.   Of course I was careful to ‘gloss’ over any problems and most of the time the other person never knew.  But it did help me to identify problems and to go back to the code later and amend my code.

More recently I’ve applied this principle to everything I write.  I can tell you from painful experience that re-reading any text to myself after writing it is not as effective at finding spelling errors, grammar errors, and just plain contextual problems as when I read the text out loud. Of course, most of the time I do not read the text to another person.  At home, I generally read the text to my pet cockatiel.  I can tell you that this bird is one of the most informed birds around…if it only understands a portion of what I’ve told it.  But at work when my cockatiel is not available, I still mouth the words in a bit of a whisper.  Anything less does not seem to work as well.  At one time I worried that people would think that I was talking to myself.  But with everyone having cell phones and Bluetooth connections so they can talk hands free, my worries of appearing insane are gone and I’m free to talk to myself anytime day or night.

So give it a chance.  If you can find someone to whom you can talk through each line of you code, great!  If they also understand how to code, even better.  Who knows? They might see something you missed.  Even if you have to talk to yourself, try it.  If not out loud, at least as a whisper.

C’ya next time, and that whispering you hear might not be your workmates talking about you, but rather it may just be the person in the next cubicle reviewing their code or report.

…or not.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s