Rubber Ducky: A programmer’s best friend


Photo by M. Snook

J. Coulter, Staff Writer

Of all the tools computer programmers have available to them, none is more valuable than a simple rubber ducky.

This may seem puzzling until you consider this all-too-common scenario. Imagine a programmer who has been working for hours on a piece of code. He knows exactly what he wants the code to do. He knows exactly what the code should do. But the code doesn’t work. The programmer could waste hours staring at his screen, willing the code to do what it’s supposed to. But he cannot distance himself enough to solve the problem, and so, he is locked into an eternal cycle of frustration, rage, and disappointment.

Unless, of course, he has his trusty rubber ducky close at hand.

The rubber ducky looks at him reassuringly, as if to say, “Tell me about your troubles. Everything will be all right.” And so, the programmer begins to talk to his ducky. The ducky, of course, does not know anything about the code, and so the programmer must start at the very beginning and explain each line, how it works, what it means, what other code it calls and what code depends on it, all in the most basic terms so that the ducky will understand. And then, in a moment of glorious epiphany, the programmer sees what he could not see before: a mistyped command, a method that calls the wrong variable, a missing semicolon, something that explains the discrepancy between what the code is meant to do and what it actually does.

The programmer rectifies his error, runs the code, sees that it finally works, and moves on to the next function. The rubber ducky sits serenely next to his computer, keeping its watchful eyes open, ready to avert the next crisis.

Photo by M. Snook

There is nothing magical about the duck, of course. It could be anything: an inanimate object, a coworker, even a baby. The key is to slow down and force yourself to really understand what your code means, instead of assuming it will do what you think it will. However, there is something uniquely comforting about the innocence of the rubber ducky’s face, and it will listen more patiently than any human ever will. A programmer should never be without one.