You don’t need to explain to anyone what a rubber duck looks like. Even the use of a rubber duck probably never raised any doubts in your mind. But the comparison to the work of a developer may seem rather strange to most. And rightly so, because we developers are strange people.
What does the everyday life of a developer look like?
To understand what we developers have in common with the rubber duck, you first have to ask yourself what a developer’s job looks like. Most of our day is spent writing new code and, unfortunately, new bugs, or reviewing old code and fixing existing bugs. Writing new, complicated lines of code gives us all great pleasure, it’s a challenge! But finding bugs in it is another story and so we come to the point.
The perfect code!
It is sometimes bitter to have to admit, especially to ourselves, that it is not the computer or the user, but the code we have written that is the cause of the error. Having to admit that the perfect code is not quite perfect after all is also part of the developer’s everyday life. But once this step has been taken, the tedious search for the cause of the error begins: a wrong line, a copy-paste error, a bad condition, a typing error, etc. There are several ways to correct the error, such as using an infinite number of print functions or using breakpoints and debuggers to check and control the programme’s progress. However, it can happen that despite all this, the error is not obvious. This is where the last rescue comes in – the rubber duck. That’s right – a yellow, lifeless rubber duck that is supposed to save us from going crazy.
What does the duck support look like?
The developer who tries to find a bug in his code puts the rubber duck on the desk next to the screen. Of course, directed so that the yellow support can see the beautiful, ALMOST PERFECT code. Then he explains out loud (which is very important!) to the rubber duck how the programme works. He goes line by line explaining individual code segments
and suddenly …. Hooray!!! Error found! Whereas one had recently been to this place 3 times and could not find anything.
Funny? Maybe, but effective
In fact, the Rubber Duck method is a proven method of problem solving, it is based on the principle of Thinking Out Loud. When we talk to ourselves (I said we are weird) – or to our duck – we focus more on the problem at hand. Researchers have analysed this way of solving mathematical problems – they showed that people who solved problems “quietly” were slower to arrive at solutions compared to those who did it “out loud”. In addition, studies were published showing that loud thinking simulates certain areas in our brain that are responsible for problem solving, planning and concentration. All this was enough for the programmers to take advantage of it.
A duck or not – it’s all about the principle
Most of you will ask, why exactly a yellow rubber duck? I have no idea. Overall, the whole idea is not really about the rubber duck, it can also be our dog or cat, but probably most often it will be our work colleague sitting next to us. I have to admit, as a developer, I have never seen anyone explain anything to a rubber duck in my many years of work. It may be because developers are more open now or there are simply more of them than in the years when this method was mentioned. In any case, I have often experienced an epiphany while explaining my problem aloud to colleagues, whether at the blackboard or while sharing a screen, and the idea came to me while I was explaining it. Talking helps – best with real people, in exceptional cases with yellow rubber ducks.
So if you see a developer talking to himself with a rubber duck on his desk – you know what’s going on!