Submit a code
No. 010 · Thinking · 5 min to apply ★ 4.3 editor’s rating

Explain it to a rubber duck

Speaking forces you to fill the gaps your inner monologue quietly skips.

Newrate it below

Why it works

When you think about a problem silently, your brain fills in steps with what it expects, not what’s actually there. That’s why you can stare at a mistake for an hour without seeing it.

Explaining out loud to someone who knows nothing forces you to make every step explicit. The gap between what you meant and what you actually did becomes impossible to miss.

It works far beyond code: essays, budgets, plans and arguments all have hidden steps that only show up when you say them.

How to use it

  1. Get a listener that can’t help

    A rubber duck, a plant, a mug. The point is that it can’t answer, so you have to explain everything.

  2. Explain what should happen, step by step

    Go line by line. Don’t skip anything because it’s obvious. The obvious parts are where the bug hides.

  3. Stop at “wait…”

    The moment you hear yourself say “wait, that’s not right”, you’ve found it.

Where it comes from
From The Pragmatic Programmer by Andrew Hunt and David Thomas (1999), where a programmer debugs code by explaining it to a rubber duck.
Read more