So, what is Rubber Ducking?
Remember when it was the norm to go into the office, daily, and we were able to to easily talk out loud to the person next to us?
My husband got me a cat. Now I love cats but my husband is a dog person. He insisted on getting me a cat. Why? Because I would read to him, out loud, content that I’d written, as a way to get feedback. The idea was that when he was away on business, I had our cat, Princess, that I could read to, instead, and sort out my thoughts.
Now, not everyone has the option to go and get a cat to talk to and it’s not always convenient to take your cat to work in order to proof your content or code, so in those cases, all you need is to try out Rubber Ducking.
Rubber ducking or rubber ducking debugging is a technique where you explain your thought process or problem to an inanimate object, such as a rubber duck, as a way of finding solutions or to give yourself clarity.
The origin of the term, 'Rubber Ducking' is unclear, but it came to prominence through the book "The Pragmatic Programmer" by Andrew Hunt and David Thomas (1999).
Six Steps for Rubber Ducking
- Identify the problem or issue you need to resolve.
- Get a rubber duck or any other inanimate object to serve as your listener.
- Start explaining the problem to the duck as if you were teaching someone about it.
- Keep talking and elaborating on your thoughts, including any questions or confusion you may have.
- As you explain the problem, you may gain new insights, identify areas of confusion, or come up with potential solutions.
- Repeat this process until you feel you have a better understanding of the problem and have identified a potential solution.
The key here is to speak out loud and take the process seriously, just as if you were speaking to a real person.
It is the actual act of speaking out loud that is key here because it helps bring clarity and focus to your thoughts. This, in turn, leads to improved problem-solving and deeper understanding.
Rubber ducking isn't just for debugging, it can be used for non-programming applications by talking through a personal or work-related issue, brainstorming ideas, or reflecting on a situation.
The simple act of talking out loud forces you to organise and articulate your thoughts in a way that makes sense, which can help you see things more clearly and identify areas of confusion or uncertainty.
Try it yourself
Not convinced? OK, try this.
Go get your cat, teddy or toy. So not your favourite mug. It has to be something that you can talk to as though it's another person.
Take something that you have written and then read it out loud. The first thing that you notice is whether or not you have put enough punctuation in. When you read out loud, you put natural pauses and spaces for breath, into your work.
Next, anything that wasn't fully formed will sound 'off', when you hear it out loud. It might be something as simple as mixing two words up such as affect and effect or missing an ‘a’ or ‘the’ because you typed too quickly.
It seems so crazy that something as simple as speaking out loud to an object can do all this, but honestly, it works. There is even a website dedicated to it.
Do you have to use a rubber duck?
Simple answer? No. What you choose to talk to needs to be something that you can relate to as representing a person.
Meet Spike. Spike belongs to Angela Channer, Principal Software Craftsperson at Codurance.
Angela uses Spike as her 'rubber duck'. Spike is invaluable to Angela and he has both an AirTag (for GPS Tracking) and a dog tag (in case he wanders off) to make sure he is available when needed.
It's all about being able to talk out loud to your chosen 'rubber duck' without feeling self conscious (OK, you might for the first few times but it does pass).
What are the benefits of using rubber ducking
- Clarity and insights: Talking through a problem out loud can help you put your thoughts in order and allow you to see your ideas more clearly. It will also help you identify any areas of confusion. This often leads to new insights and understanding.
- Improved problem-solving: The act of explaining the problem to another being, even if it's just a rubber duck, can help you find possible solutions and solve the problem more effectively.
- Increased focus: The process of rubber ducking requires you to focus your attention and articulate your thoughts. Just doing this helps you to avoid distractions and concentrate on the task at hand.
So, go on, get out your rubber duck, Spike or pet and talk to them.
Cat Tax - Princess rubber ducking with me