What is "Rubber Duck Debugging"?

NicolasBrondinBernard

Author
@NicolasBrondinBernard

So-called rubber duck debugging.

Article published on 13/08/2021, last updated on 10/08/2026

This article is also available in audio format!

Finding the cause and resolution of a bug in code is an integral part of being a developer, with some issues even taking several days to fix.

Sometimes, even once the "bug" has been detected, reproduced, and isolated, the method for resolving it can remain very tricky to find, at least for the person who wrote the code in question.

It then happens that we need to go ask another developer for help in order to get a fresh perspective, and find and implement that famous solution.

But two drawbacks arise:

  • You don't always have a dev available on hand
  • If it's done too repeatedly, you lose autonomy

Fortunately, there's an ancestral technique (no less) that you can easily set up, with very good results:

Talking to a rubber duck

I know, it sounds weird if you're not used to it, but it really works!

In reality, when we explain a technical problem to someone (whether a developer or not), we're forced to simplify the system, the inputs, the outputs, the logic, etc...

You have to explain methodically, going line by line, as if you were teaching something to the person, and if we refer to a famous saying:

The best way to learn/understand is to teach

That's why most of the time, when you ask someone for help with a code problem, it's actually you who finds the solution first.

And there's a reason for this: our brain is partly wired to detect a lack of logic, and when you express a problem out loud (or in writing) by explaining it step by step, your brain is better able to detect the various flaws in your reasoning.

That's why some developers have replaced their habit of asking another human for help with a rubber duck placed on their desk. This is what's called "Rubber Duck Debugging"!

In reality, the technique works with all sorts of inanimate listeners, such as a houseplant, a teddy bear, etc...

Less plastic, and more houseplants!

What you should remember is that calmly expressing and explaining your technical problems out loud will allow you to solve them on your own, and sometimes even faster!


Jonathan Kemper sur Unsplash

Finished reading this article?
Our newsletter

No spam. Only free content, news, and ever more resources to level up your skills!

Join +1500 developers

Comments (0)

to leave a comment

No comments yet