The Rubber-Duck Test for Code You Actually Know
Rubber duck debugging gets taught as a debugging trick: explain your code line by line to an inanimate object, and the act of narrating it out loud surfaces the bug you couldn't see by just reading. That part's true. But the same exercise is also a genuinely reliable test for something else — whether you actually understand a piece of code, or just recognize it.
Those two things feel identical from the inside. Reading a function and thinking "yeah, that makes sense" is a much lower bar than being able to produce an explanation of it, out loud, in order, without checking anything. The gap between those two only shows up once you actually try the second one.
Recognition is cheap; explanation is expensive
Recognition is fast, automatic, and doesn't require holding much in your head at once — you're just matching a shape you've seen before. Explanation forces you to actually hold the whole causal chain: why this line exists, what would break if it didn't, why the code is structured this way and not some other reasonable-looking way. That's a fundamentally different, more expensive cognitive operation, which is exactly why it's a better test.
Why this matters more now, not less
This gap used to surface naturally, because writing code from scratch forced you through the "explain it to yourself first" step whether you wanted to or not. Autocomplete tools are good enough now that a lot of code gets accepted on recognition alone — it looks right, it runs, and the explanation step just never happens. That's fine until a code review, an interview, or an incident asks you to produce the explanation on the spot.
How to actually run the test
- Pick real code, not a toy example. Something you wrote last week, or a function from a project you're proud of. Testing yourself on code you've never really internalized in the first place doesn't tell you anything new.
- Explain it out loud, not in your head. Silently reading through an explanation lets you skip the hard parts without noticing. Saying it out loud, or typing it as if to someone else, forces every gap to actually surface.
- Notice exactly where you slow down or hedge. "I think this part handles the edge case where..." is the sound of recognition standing in for understanding. That's the part worth going back and actually working through.
- Then try modifying it, live, without looking anything up. Explaining is one bar; changing the behavior correctly on the first try, unassisted, is a higher one — and it's usually the one that actually gets tested in an interview or a live debugging session.
Building the habit on purpose
You don't have to wait for an interview to find out where the gaps are — you can go looking for them deliberately, on code you already think you know, on a regular basis. It's uncomfortable in exactly the way that's useful: it's the fastest way to find out that "I know this" and "I can produce this" aren't the same claim.
Short daily practice on SoloScript works on the same principle from the other direction — writing a solution from memory, with nothing to lean on, is the rubber-duck test built into the exercise itself, before you ever get to an interview where the stakes are higher.
Free, no account needed. A few minutes a day is enough to feel the difference.
Start practicing