Rubber ducks

Have you ever been in a situation where you have a problem or a question, and simply by explaining it to another person, you find the solution yourself? And not because the other person did anything in particular...

In fact, “the other person” doesn´t even have to be a person at all. It can even be an object, like a rubber duck for example.

yellow duck toy beside green duck toy

And I say rubber duck because this is exactly the name that´s been given to this technique in the IT world: the rubber duck debugging method.

This method proves really useful when you´re programming and get stuck trying to resolve an error (or bug) that´s preventing your application from behaving as it should. The idea is to explain the situation to the rubber duck, and to do it in great detail because of course, the duck knows absolutely nothing about your application. So you have to explain the context, the exact problem you´re trying to solve, how you´re trying to solve it, the code you´ve written line by line… And very often what happens as you´re going through it with such a level of detail is that you suddenly realize where the problem is, and how you can solve it.

Super cool, right?

You might be wondering: ¿why a rubber duck? Honestly, I don’t know, maybe it all started out as a joke, but the truth is that this method is as useful as it is simple (once you get over the awkwardness of talking to a duck, or any other inanimate object of your choosing), and can be used not only for debugging code but for life in general.

I imagine this technique works so well because it forces you to take the problem out of your head and see it from the outside, from a different perspective, so you stop going about it in your head the same way again and again. Moreover, the action of going through it step by step and out loud helps you to focus on details that you may have overlooked before, that way increasing the chances of identifying the real problem and finding a solution.

What do you think? Are you willing to give it a try? Perhaps next time I see a rubber duck in a shop, I´ll buy it to keep it here by my computer :-)

3 thoughts on "Patitos de goma"

  1. Supongo que es el mismo principio que usa la cultura de Guatemala para sus famosos muñecos quitapenas ;). O por lo que mi abuela (vivía sola en el campo) le hablaba a sus amcetas y plantas….

  2. Bueno, aquí en mi sitio ahora no tengo «juguetes», pero en Madrid recuerdo que todos teníamos un peluche, un muñeco, una bola anti-estress encima del ordenador… Bueno, y al «experto», un bote de Imaginarium que al darle la vuelta y recolocarlo mugía como una vaca. Supongo que el que puso nombre a la técnica tenía un patito de goma 🙂
    Nosotros normalmente era, cuando no encontrabas el problema y le pedías ayuda al de al lado… Le empezabas a explicar lo que ocurría, y muchas veces, a mitad de explicación, parabas de golpe, y decías un ¡¡Espera!!
    Nunca me había dado cuenta que realmente lo que haces es revisar punto por punto todo el diseño y desarrollo que has hecho

Leave a Reply