Rubber Duck Programming

Rubber Duck Programming

Rubber Duck Programming, also known as Rubber Duck Debugging, is a technique used by programmers to debug code by explaining it, line by line, to an inanimate object such as a rubber duck. The concept is this: when a programmer encounters a problem in their code, instead of immediately seeking help from a colleague or diving into complex debugging tools, they explain their code to the rubber duck.

The process of articulating the problem and the code often leads the programmer to identify the issue on their own. It's a form of cognitive debugging, as it forces the programmer to think through their code more thoroughly, often revealing the mistake or oversight in the process.

The name "Rubber Duck Programming" originates from the story in the book "The Pragmatic Programmer" by Andrew Hunt and David Thomas, where a programmer carries around a rubber duck and explains their code to it, thereby often solving the problem without any further assistance.

While it might sound silly, Rubber Duck Programming can be surprisingly effective and is widely used in the programming community as a low-tech, yet powerful debugging technique.

This works a great deal outside of the coding space as well. I've only recently heard of this concept because Pirate Software talked about it on a short. I've used it so much that I decided to write a blog piece about it for others to explore the concept in the regard I did. My partner was recently gifted a knitted support pickle and it has since been gifted to my workspace with much appreciation. I didn't think it was going to work as well as it was made out to believe at first, but my tune turned a 180 real quick. Sometimes I merely look at it and my problem is solved.

Let me know your thoughts on this in the comments below.

Back to blog

1 comment

The rubber duck idea is novel. Never thought about it but the concept makes sense. Will have to apply it soon

Andrew fillion

Leave a comment