When we hit a wall with a problem, a simple way to solve it is to take a break and explain the issue to a rubber duck. This entertaining concept started from a story in The Pragmatic Programmer book where a programmer would carry around a rubber duck and explain their code to the duck in detail.
You’re stuck with a difficult bug. You’ve already spent a lot of time on it, and the deadline is looming. So, you ask a co-worker for help. They walk over to your screen, and you begin to explain what’s going on—and what’s going wrong. Before you get very far into the description, a flash of insight smacks you in the head, and you exclaim, “A-ha!” You’ve found the bug. Your bemused co-worker, who never had to say a word, shakes their head and walks back to their own office. To save some wear and tear on the carpet (and your co-worker), we suggest you place a surrogate—a yellow rubber duck, for instance—near your screen and, when you get stuck, just “talk to the duck.”
Andy Hunt, Dave Thomas – The Pragmatic Programmer
Throughout my career in software engineering, I’ve applied this method countless times. The process can involve an actual rubber duck, a colleague, or even myself impersonating the role of the “duck”. There’s a unique, delightful thrill in hearing the question, “Can you be a duck for a few minutes?”
While explaining a concept or a problem to a person or an inanimate object, our thinking slows down as we describe our issue in excruciating detail. It is not who or what we are talking to but hearing ourselves talking about the code, line by line. Anything that sounds somewhat confusing or ridiculous might be the cause of our problems, urging us to fix them.
Introducing this concept to children taps into their vivid make-believe world. Whether they’re talking to a toy, a peer, or a parent, verbalizing their problem can often lead kids to discover potential solutions.
For this method to be effective, it’s crucial that children slow down and patiently explain what they are attempting to accomplish. They should explain everything they tried, what they expect every step to produce and why it should do so. Over time, children will likely realize that they’ve been explaining something that, upon reflection, doesn’t quite add up, leading them to a road of discovery that started from “uh-oh” to “uhm” and, hopefully, “aha”.
This effort encourages improved communication skills by prompting a clear expression of their thoughts, helps to identify overlooked details, and fosters process-solving skills by assessing the logic behind their reasoning. And, of course, incorporating a toy adds an element of fun to the learning process.
It may be beneficial for younger children to initially discuss their issues with a trusted adult before gradually integrating toys into the equation.
Also, let’s not forget that problems will have different orders of complexity: some will require only one duck, but others need a whole crew of ducks and teddy bears and cars and princesses.
In essence, rubber duck debugging is a fantastic metaphor for thinking aloud and overcoming obstacles.
Nothing clears up a case so much as stating it to another person.
Sherlock Holmes in Sir Arthur Conan Doyle’s “The Adventure of Silver Blaze“
Image credit: Wikipedia