Rubber Duck Debugging
On Panodyssey, you can read up to 30 publications per month without being logged in. Enjoy28 articles to discover this month.
To gain unlimited access, log in or create an account by clicking below. It's free!
Log in
Rubber Duck Debugging
Have you ever been stuck on a problem and could not figure out the solution no matter how hard you tried to problem solve it? You tried and tried and yet you found yourself making no progress. So in frustration you pushed away whatever you were doing, walked down the hallway to find your spouse and exclaimed:
“Dear, I need your help! I have this problem and I can’t fix it!"
“Yes honey, what’s the problem!? How can I help?” your spouse replies.
So you start explaining this problem and suddenly you find yourself pausing mid sentence and saying “actually, you know what? I just found the answer!”.
This happened to me COUNTLESS times over different aspects of my life, not just in learning programming. On the other hand, I have had others come to me to ask a question, only to find that they found the answer to their own question mid sentence, or sometimes even before they started explaining the problem to me.
In the software development world, this is known as “Rubber Duck Debugging”, but chances are, you have done a variation of this yourself in some aspect of your life, you just didn’t know it as this!
So, when you get stuck on a problem.. try explaining it to someone else or some inanimate object.
What is Rubber Duck Debugging?
David B Hayes of thoughtful code explains the psychology of why this happens in 2 shifts:
-
There is a strong likelihood that you will slow down and be more contextual when explaining your problem than when you were power typing that code, or speed reading that Flight Operations Manual.
-
Whoever or whatever you are explaining the problem to, may not have the same level of understanding of the subject that you do. So therefore you are forced to explain the problem in a much bigger picture, sometimes explaining the foundational knowledge to then get to the specialised area where you are stuck.
So if your duck doesn’t know how to code, or fly an airplane, you have to first teach the duck how to code, or how to fly an airplane!
It is this exact psychological shift that makes rubber duck debugging effective. Suddenly you were forced to break out of that rut. You approached the problem from a completely different angle. That's the key takeaway.
What if this didn't fix it?
Perhaps this didn’t work. perhaps you are still stuck after explaining a problem for hours.
Have you ever had a situation where you worked on a problem only to get constantly stuck, then have the answer come to you in the middle of the night when you were sleeping? Or having a bath?
Your subconscious mind had probably been working on the problem the entire time in a stage of creativity know as the ‘incubation’ stage which then led you to having your eureka moment.
https://www.interaction-design.org/literature/article/what-are-the-stages-of-creativity
Your brain works on things constantly. Sometimes it just needs to be redirected to look at the bigger picture.
The last keypoint is try teaching someone. If you never share or teach the knowledge you know with anyone, you are actually shortchanging your own development.
If you teach someone, your understanding of the topic itself will become better. Because it makes you retrieve what you have learnt and also makes you learn the material to a deeper level of understanding to then teach someone. Isn’t it funny, when we teach something to someone, the benefit of that learning is returned to us!
To Summarise
-
Try explaining the problem to someone or something else.
-
Allow the problem to incubate/sit in your subconscious mind
-
Teach others what you have learnt.