Rubber Duck Problem Solving

@Christopher Allen-Poole, if you’ve gone to the trouble of typing out the question, self-answering is encouraged on SO, so go ahead and give the community the benefit of your experience.

That exact thing happened to me a couple months ago: http://stackoverflow.com/q/8715738/99640

The question wound up so long and involved that it seemed a shame to throw it away, so I posted it and answered it myself.

I love your article, so please ask Bob the Duck out loud: “Why doesn’t Stackoverflow have a cancel button on the Ask Question page?”

I have had a duck by my work computer for the past 7 years. It has been a great help in maintaining an old code base.

Even though it was more or less dismissed in the linked coding buddy article this is basically the entire crux of pair programming in Agile development.

And for some reason many developers swear blind that they must only work alone without interruption from anyone else.

Plus of course there is another major benefit from pair coding that few talk about. http://almaer.com/blog/pair-programming-productivity

When I was a lone “engineer”, I once had an Exchange issue that I couldn’t solve - partly because I didn’t then know the answer and partly because I was too stretched for resources to devote the time needed to finding the answer.

Anyway, my employers agreed that in the short term they’d call a consultant in to help me fix the exchange issue and they’d hire me an assistant.

On the day the consultant turned up (he was one we’d used before and I knew quite well) I started explaining the problem to him, and yes, the sheer act of explaining the issue to someone who understood it and needed the technical details caused the probable fault and a solution to pop into my mind. The consultant started laughing when I told him this and claimed he could actually see the lightbulb start glowing over my head even before I told him this.

So it works with more than one person, and I guess with the rubber duck if you can bring yourself to explain the problem in proper detail to it.

The consultant was still useful; given how little time I had, he spent two days proving my latest theory and then implementing and testing my solution. It was still a two person job anyway and that’s something that rubber duck problem solving doesn’t help with.

It should be Teddy Bear not Rubber Duck!

See the 1999 book The Practice of Programming

http://cm.bell-labs.com/cm/cs/tpop/debugging.html

Our questions are directed towards a picture of Arthur Fonzarelli on the wall.

The Fonz always knows the answers.

The Fonz always knows the answers.

I answer questions on SO and I’m also a moderator at a Java forum website.

The overwhelming majority of people don’t seem to understand how to ask a question properly on SO or in the forums. Every day there are people posting a single line “Why doesn’t my program work?” followed by 1000 lines of code, people who post “I get an error!” without even bothering to write what the error message is, people who think that somehow someone else on the other side of the Internet can read their mind, people who don’t even know themselves what the question is that they’re asking, etc.

The rubber duck would certainly take care of many of those people. And if they ask “Bob”, they should at least try standing in the shoes of “Bob” so they realize what they need to tell Bob for their question to be answerable.

Also, I meant to link to this great blog post which is yet another example of this realization:

http://remarkablepixels.com/blog/2011/1/5/the-best-question-is-the-one-never-asked.html

Sometimes I wonder if you even need to ask the duck the question. Often if I can’t solve a problem I just move onto another task. When I come back to the original task a day or so later, the problem seems to be much easier to solve. (That obviously doesn’t work if you have a deadline and can’t just move on to another task.) Perhaps asking the duck is just taking your brain off the original problem and giving it something else to do for a while.

Sir, I've followed your suggestion, but then I have another question:

what about if I do not have a duck in my office ?
whom should I ask where I can find a duck to ask for ?

Hi Jeff: You are observing that “something about writing it down makes me think along extra lines of thought.”

I would like to add another observation, mainly because the link is obvious, but (still) not well understood: the acceptance of logical rules of inference (modus ponens, say) is closely related to literacy. There’s quite a body of research out there now showing that illiterate people are not willing, or unable to accept formal rules of inference, research which is adumbrated by the fact the the first formalization of logic, Aristoteles,’ was more or less concomitant with the introduction of literacy to Greek society (Socrates, for example, was still illiterate, (although he knew how to use logic well)).

A principal researcher in this field is Philip Johnson-Laird of Princeton

http://psych.princeton.edu/psychology/research/johnson_laird/index.php

By the way, have a look at my blog:

http://morefreedomfries.blogspot.ch/2012/09/freedom-fries-introduction.html#more

Cheers…

Framing is the question is always worthwhile. But the questions of newbies often make sense only in terms of a specific combination of ignorance and misapprehension. The best way to help is to look at what they do seem to know and hand them the corners of the metaphorical jigsaw puzzle. This often results in a much improved formulation of the question, a self-closure or self-answer.

But these people are made profoundly unwelcome by communities like Stack Overflow because they are not well equipped to ask a good question, and even if they do, they are not sufficiently steeped in the customs of that field to use phraseology that causes duplicates to show up while they are composing a question.

Recently I experienced this for myself when I embarked on a crash course of self-ed in Microsoft’s implementation of MVC with Durandal, Knockout and Bootstrap. For the first time in decades I floundered, not even knowing the extent of my ignorance. It was highly unpleasant and more than once I had a question closed as duplicate simply because I wasn’t wording things the way I would if I didn’t need to ask.

You can use digital version of Rubber Duck Debugger available on google play

This is still one of my favorite techniques for problem solving. Been doing it for years without having a name for it.

Your post has given me a wonderful name to use when I teach the technique to others - one that no one ever forgets.

Interestingly, it seems that the term “rubber duck debugging” has been coined in 1976 by Stack Overflow user greg-449 (cf. greg-449’s Developer Story), who is an amazingly helpful and swift answerer on all questions [eclipse] and [eclipse-rcp], which is enough reason for an honorary mention here.

1 Like

My son has been trying to code the second coming of sans, but sadly he has been having complications with his codes and he can’t seem to be able to make a working sans undertale.
Arigato :slight_smile:

Your great link went stale. I now found it on http://www.cs.princeton.edu/~bwk/tpop.webpage/debugging.html

1 Like

There’s always Clue Debugging… :wink:

1 Like