It has happened at least once to all of us: we tried to solve a problem of some kind, thinking it over silently in our heads for minutes, hours or even days, reaching exhaustion with no conclusion.
Then we gave up and asked a classmate or a colleague for help and, while we were explaining our problem in every detail, we suddenly found the solution.
In cases like this we have unknowingly used the simplest, but often least used, debugging method in software engineering: rubber duck debugging.
What is rubber duck debugging?
Rubber duck debugging is a method that helps developers find a solution to the problem they are stuck on, simply by stating and articulating every component that describes the problem itself.
It is not essential for the developer to be talking to another developer: according to this method, the other party could be someone who knows absolutely nothing about code, it could be your own dog or cat, or even an inanimate object.
It really does not matter who is on the other side, whether they are asleep or actually listening. Sometimes, having a listener who has no idea what you are telling them even gives you a kind of blank page, a point zero from which to start and rebuild your problem from another point of view.
The origins of the method
This method first appears in the book The Pragmatic Programmer: From Journeyman to Master, written by Andrew Hunt and David Thomas in 1999, along with other methods and principles that are still the foundation of modern computing.
The book tells the story of a developer who used a rubber duck as a sounding board to solve complex code problems. The developer would put the duck on the desk and explain the code to it line by line, often finding the solution during the explanation.
The genius of this method lies in its simplicity: the act of putting a problem into words forces us to structure it clearly and logically, bringing out contradictions or gaps in our reasoning that would otherwise stay hidden.
What are the exact steps to put it into practice?
- Buy, borrow, steal, make or otherwise obtain a rubber duck (the bath-tub kind).
- Place the rubber duck on your desk and tell it you are about to go over some code with it, asking whether that is all right.
- Explain to the duck what your code is supposed to do, then go into the details and explain the code line by line.
- At some point you will tell the duck what you are going to do, and then you will realise that it is not what you are doing. The duck will sit there serenely, happy to have helped you along the way.
Source (https://rubberduckdebugging.com/)
Digital tools for rubber duck debugging
Don't have a duck, or have one but want to talk to a virtual duck?
A website has been created with the sole aim of explaining the method and giving tools to everyone, especially those who cannot get hold of a rubber duck: rubberduckdebugging.com.
In the "Talk to a duck" section you will also find a chatbot that replicates the behaviour of a typical rubber duck (not quite the classic duck, but it comes very close).
Why it works: the science behind the method
I am not a psychology expert, but from the research I have done, rubber duck debugging works for several reasons:
- Externalising thought: When we speak out loud, we activate different areas of the brain than in silent thinking, creating new neural connections.
- Cognitive restructuring: The act of explaining forces us to reorganise our ideas in a linear, understandable way.
- Psychological distance effect: Talking to an external object creates emotional distance from the problem, letting us see it more objectively.
- Change of perspective: Explaining something to a "beginner" (the duck) forces us to simplify and clarify concepts, removing wrong assumptions.
A few key takeaways
For professional and personal growth, it is always better to use every tool you have before having someone else point you to the right way.
So the next time you face an obstacle, before going to your tutor or your more experienced colleague, use this method to work out where the problem is.
In some innovative companies, such as Quinck, the first thing given to new hires with little experience is a rubber duck.
Conclusion
Rubber duck debugging is much more than a simple programming technique: it is a powerful cognitive tool that draws on our innate ability to clarify our thoughts by putting them into words.
The next time you are stuck on an apparently unsolvable problem, don't underestimate the power of a simple conversation with a rubber duck. You may find that the solution was already inside you, and only needed the dialogue to come out.
And remember: sometimes the deepest answers come from the quietest listeners.


