I’d never heard that expression, though I was familiar with the technique (with a teddy bear, though, not a duck). That said, I wasn’t actually programming at the time, just trying to understand what the code did.
I think I’ve seen it explained with a rubber duck more often, but I learned it
first with a teddy bear too, probably on page 123 of Kernighan & Pike’s
“wiener dog book”:
Another effective technique is to explain your code to someone else. This
will often cause you to explain the bug to yourself. Sometimes it takes no
more than a few sentences, followed by an embarrassed “Never mind, I see
what’s wrong. Sorry to bother you.” This works remarkably well; you can
even use non-programmers as listeners. One university computer center kept a
teddy bear near the help desk. Students with mysterious bugs were required
to explain them to the bear before they could speak to a human counselor.
This is called rubber ducking.
I’d never heard that expression, though I was familiar with the technique (with a teddy bear, though, not a duck). That said, I wasn’t actually programming at the time, just trying to understand what the code did.
I think I’ve seen it explained with a rubber duck more often, but I learned it first with a teddy bear too, probably on page 123 of Kernighan & Pike’s “wiener dog book”:
Yes! That’s exactly the anecdote wherein I first learned it.