Skip to main content

Verified by Psychology Today

Career

Stuck? Ask a Rubber Duck

Solve problems by explaining it to someone – or something.

Key points

  • Many problems can be solved by simply explaining them to someone – even if that someone is just a rubber duck.
  • Programmers use the "rubberducking" technique, which comes with a side benefit: it doesn't interrupt others.
  • Self-explanation also helps find areas where we may need to spend some more time developing our knowledge.

In one of the nerdiest internet jokes ever, Stack Overflow, a website for programmers, introduced a rubber duck for an April Fools’ Day joke. The duck’s role was to help visitors solve computer programming problems. It would listen to people’s questions, and after hearing them out, the duck would start “typing,” only to produce a mere “quack” after the wait.

As any software developer can tell you, many problems can, in fact, be solved by simply explaining the situation to someone – even if that someone knows nothing about the field, is not particularly smart, and is not interested in offering any guidance whatsoever. And yes, even if that someone is just a rubber duck. The solution doesn’t come from the outside – it is found in the process of explaining the problem in natural language.

Of course, this technique isn’t only for programmers, but it is taught in computer science and software engineering courses, where we tend to call it “rubber duck debugging,” or “rubberducking” for short. The moniker comes from a story told in the book The Pragmatic Programmer by Andrew Hunt and David Thomas, in which a programmer uses a duck to force themselves to think through the software code, line by line.

More generally, having to explain or teach a subject forces you to evaluate the subject from different perspectives, which can then provide a deeper understanding.

It’s self-explanatory

The act of explaining code to an external entity is a form of self-explanation. Whether the listener is another person or a children’s toy, explaining forces a person to articulate their thoughts, which involves spending time explicitly analyzing and focusing on a problem. This process, in turn, can reveal hidden assumptions, logical errors, or overlooked details.

Researchers, such as university professor and author Michelene T.H. Chi, have explored the benefits of self-explanation in learning and problem solving. The basic idea is that, when individuals explain concepts or problems in their own words, it enhances their understanding and retention of the material. Not only that, but self-explanation also encourages a deeper level of cognitive processing and helps identify gaps in comprehension.

In describing what the program is supposed to do and observing what it actually does, for software developers, any discrepancy becomes apparent. Self-explanation tends to produce better results than merely thinking aloud without an audience. And there is an added benefit to using an inanimate object: The programmer won’t need to interrupt anyone.

The self-explanation effect in learning has also been examined across many disciplines, and it works across the board – in chemistry, biology, mathematics, nursing, etc. Furthermore, self-explanation is a useful tool for helping a learner integrate new knowledge with existing knowledge, allowing them to update and refine existing mental models.

Another benefit of self-explanation is that students can also become more aware of their actual level of understanding and find areas where they may need to spend some more time developing their knowledge.

Knowledge comes in pairs

Introverts, in particular, tend to love software development jobs, appreciating the lack of human interaction in their day-to-day work. Some interactions, however, are quite valuable. For example, teamwork can help spread specific knowledge within the company and help individuals further develop their skills.

Pair programming is another problem-solving technique practiced by software teams. As the name suggests, this is a type of teamwork in which two software developers sit at the same computer and work away on a programming problem. They’ll look at the same piece of code, with one person typing while the other person reviews everything in an observer role. This process is quite similar to how rubber duck debugging works: As the “driver” is writing the code, they are also explaining what the program needs to do and how the new additions will achieve that.

Working in pairs also encourages focus and reduces distractions. And with two sets of eyes on the same piece of work, errors and mistakes are often caught early on. Likewise, as the two individuals discuss design decisions, code structure, and potential improvements in real-time, their constant dialogue helps ensure a shared understanding of the project they are working on.

In addition to facilitating knowledge transfer, working in pairs also functions as a bonding exercise for team members, or for mentor-mentee relationships. Just think of a junior team member who gains exposure to different approaches and problem-solving techniques by working with a more experienced colleague.

Some jobs even go so far as to require that team members work together quite closely. For example, commercial airplane pilots usually have a copilot in the cockpit, and medical teams also work together during surgeries or complex procedures. Or, in the movie industry, the collaboration between two film editors can result in a more polished and seamless final cut.

Working in pairs can also be good for creativity. For instance, music composers or songwriters quite often work in artist duos to create original compositions, in which each member brings their unique ideas, talents, and perspectives to the piece. Regardless, whether the other member of the pair is a real person or a toy, talking through problems is a great tool for getting unstuck and producing great work.

References

Chi, M.T.; de Leeuw, N.; Chiu, M.-H.; Lavancher, C. (1994). Eliciting Self-Explanations Improves Understanding. Cognitive Science 18, 439-477. http://chilab.asu.edu/papers/ChideLeeuwChiuLaVancher.pdf

Durkin, K., (2011). The Self-Explanation Effect when Learning Mathematics: A Meta-Analysis. Paper presented at the annual meeting of the Society for Research on Educational Effectiveness, Washington, DC. http://files.eric.ed.gov/fulltext/ED518041.pdf

advertisement
More from Richard Dancsi
More from Psychology Today