Developer’s best friend: the rubber duck

Developer’s best friend: the rubber duck

You wouldn’t say, but rubber ducks are great mentors, which is why I think they’re such good friends of programmers. There aren’t many rubber ducks with a diploma, but they have a very useful superpower: understand nothing about the bug you have 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, in case you like sweets as much as I do. All you have to do is tell your problem to the duck, and only by explaining, in as much detail as possible, what your code is supposed to do, somehow – it happens almost all the time – will you find the solution. The duck will stay there motionless, satisfied knowing that she helped you on your way.

This is what the rubber duck terminology refers to and comes from a book by Andrew Hunt and David Thomas: The Pragmatic Programmer. The authors tell a story about a programmer who carried a rubber duck and debugged their code by explaining what was happening in the code, line-by-line, to that duck.

Some studies show that verbal explanation of a concept helps you understand it better. This is because we all have the impression that we know an idea, but we often neglect to generate a detailed explanation. The question of a stranger somehow forces us to replace our false sense of understanding with a logical, rational basis. Once you have to explain to someone who doesn’t understand anything, you stop taking things for granted and look at the problem with fresh eyes.

Another reason this technique is so popular is that we often no longer need to seek help from our teammates who may be busy. Our duck will have a lot of patience with us and has no expectations. Of course, if you’re stuck, you shouldn’t be ashamed to ask your teammates for help.

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

Comments (0)
Join the discussion
Read them all


Hide Comments

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

Please upgrade today!