Rubber Duck Debugging
Updated 2026-07-30
Summary
Rubber duck debugging (or rubberducking) is a debugging technique in software engineering, wherein a programmer explains their code, step by step, in natural language—either aloud or in writing—to reveal mistakes and misunderstandings.
Definition
When the code doesn't work, find a rubber duck and explain to it, line by line, what your code is doing. Usually, halfway through the explanation, you will discover the bug yourself.
Introduction
How to use
- Output is input: When you have to transform vague thoughts into clear language (explaining to the duck), you force your brain to organize logic. When stuck, don't rush to ask others; first explain to the air.
Mechanism
The programmer explains the code step by step to a rubber duck, and in the process of 'teaching', they discover the problem themselves. It forces implicit assumptions to become explicit, using articulation to clarify logic.
Practice
In progress 0/3Practice this model in one real situation:
Cases
- During development debugging, explaining the function call to a rubber duck reveals a variable scope error. A writer reading a draft aloud to an outsider exposes logical flaws.
Common pitfalls
- Rushing through key points during the explanation is unhelpful; relying on it as the only debugging method while ignoring tools and tests; being embarrassed to 'talk to an object' and giving up.
Sources
Source support: Explicit
References currently contain only Wikipedia links; primary sources still need review.
- en.wikipedia.orghttps://en.wikipedia.org/wiki/Rubber_duck_debuggingverified
account_treeGenealogyexpand_more
PRIVATE NOTES · Only visible to you
SAVED Q&A
ENTRY Q&A · Private saving available
Ask with a clear boundary
thinkingmodels answers from published entry context only.
Your question is sent to thinkingmodels. The answer uses public entry context only.
RELATED MODELS