Rubber duck debugging
Math & Computing
Category: Math & Computing
In short
Explaining your code line by line to a rubber duck until you spot the bug yourself.
The story
The idea spread from a story in the 1999 book The Pragmatic Programmer. A programmer carried a rubber duck and, whenever stuck, explained the code to it one line at a time. Putting your reasoning into words forces you to notice the assumptions your head had quietly skipped.
The lens
If you have ever solved a problem halfway through writing a message asking for help, you know the effect. The listener doesn’t even need to be human.
Drop it casually
“Thanks for listening. I figured it out while explaining it. You’re an excellent rubber duck.”