a companion discussion area for blog.codinghorror.com

Rubber Duck Problem Solving


#21

I use a similar method to make sure I truly understand something. I create a 5 minute presentation on the subject intended for a public audience. If you can’t explain it in 5 minutes you don’t really understand it. Similar to the business concept elevator pitch https://en.wikipedia.org/wiki/Elevator_pitch


#22

One more technique: I never post a question until I’ve written the simplest possible program that demonstrates the problem. Most of the time, the act of doing this shows me the solution

If not, then at least I’ve provided the StackOverflow community with something concrete and simple that they can work from.

Plus it eliminates most of the “have you considered…” non-answers.


#23

A couple of places I worked we called it “A Second Set of Eyes.” We hadn’t made the leap to an inanimate object.

And, I’m another one who has started to type up a question or two, only to abandon it. Either by ruling out obvious refining questions, or by producing a simple example of the problem.


#24

Regardless of how detailed is your internal representation/understanding of the problem it always makes sense to just verbalise it - my theory is that it just activates different neural passages in your brain which eventually helps in finding the solution.


#25

We always called this “talking to the bear”, after a plush teddy bear that allegedly at one time. It became traditional, when asking a co-worker a question, to start with “would you mind being the bear for a minute?”


#26

I wish I’d thought of the funny nomenclature, but I didn’t. I did however, express this thought back in 2004: http://www.mooreds.com/wordpress/archives/193

Dan Moore


#27

@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.


#28

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?”


#29

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.


#30

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


#31

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.


#32

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


#33

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

The Fonz always knows the answers.


#34

The Fonz always knows the answers.


#35

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.


#36

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


#37

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.


#38

Sometimes when I have stared at code so long that I’ve memorized it, instead of a rubber duck, I imagine one of my most brilliant and demanding teachers, to whom I present the code as correct.


#39
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 ?


#41

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…