Rubber duck debugging is a problem-solving technique where you explain your code and the bug you're facing out loud — traditionally to a rubber duck, but now often to an AI assistant. The act of articulating the problem clearly often reveals the solution. AI has become the ultimate rubber duck: it actually listens and responds.
Named after a story in 'The Pragmatic Programmer' (1999) where a developer would debug by explaining code line-by-line to a rubber duck on their desk. The insight: forcing yourself to explain a problem clearly often exposes the flaw in your logic.
Rubber duck debugging is proof that the best debugging tool is clear thinking. AI just made the duck a lot smarter.
When code lives in your head, it's easy to skip over assumptions. When you explain it:
| Traditional Rubber Duck | AI Rubber Duck |
|---|---|
| Listens silently | Actually responds |
| You find the answer yourself | AI might spot it first |
| Can't ask follow-up questions | Can probe deeper |
| Always available | Always available |
| Free | Sometimes free |
You: "My function should return users sorted by date, but they're coming back in random order."
AI: "Are you sorting in the database query or in JavaScript after fetching? If you're sorting after fetching, are you using sort() correctly with dates?"
You: "...oh. I'm sorting strings instead of Date objects."
When stuck for more than 5 minutes:
The answer usually appears before you finish explaining.