Developer’s best friend – the rubber duck

Developer’s best friend

– the rubber duck

You wouldn’t think so, but rubber ducks are great mentors, which is why I believe they’re such good friends to programmers. There aren’t many rubber ducks with diplomas, but they have a very useful superpower: they understand absolutely nothing about the bugs you encounter as a developer. You may be wondering now, how does this help? After all, any static object has this quality.

Let me explain. It’s called Rubber Duck Debugging. It can be anything: a cat, or even a Kinder egg toy, if you like sweets as much as I do. All you have to do is explain your problem to the duck, and simply by describing, in as much detail as possible, what your code is supposed to do, something magical happens—almost every time—you find the solution. The duck will sit there motionless, satisfied that it has helped you on your journey.This is what the term “rubber duck debugging” refers to, and it originates from a book by Andrew Hunt and David Thomas, The Pragmatic Programmer. The authors share a story about a programmer who carried a rubber duck and debugged their code by explaining, line-by-line, what was happening in the code to that duck.

Some studies suggest that verbal explanation of a concept helps you understand it better. This is because we often believe we understand an idea but fail to articulate it in detail. Explaining it to someone—or something—that doesn’t understand forces us to replace our false sense of understanding with a logical, rational foundation. Once you have to explain a concept to someone who knows nothing about it, you stop taking things for granted and examine the problem with fresh eyes.

Another reason this technique is so popular is that it reduces the need to ask for help from teammates, who may be busy. The duck will patiently listen and has no expectations. Of course, if you’re stuck, you shouldn’t hesitate to ask your teammates for assistance.

If you get bored with your rubber duck, you can find virtual ones online. Or, you can even become one (without growing a beak) by collaborating with others in real-time and listening to their technical problems.

I hope this article has been helpful in explaining the Rubber Duck Debugging method.

Thanks for reading.

Comments (0)
Join the discussion
Read them all
 

Comment

Hide Comments
Back

This is a unique website which will require a more modern browser to work!

Please upgrade today!

Share