The origin of the idea is in the book “The Pragmatic Programmer”, written by Andrew Hunt and David Thomas. The book features a story about a programmer who would bring a rubber duck around with them and debug their code by explaining it to the duck, line by line.
Rubber duck debugging
Rubber duck debugging, or rubber ducking for short, is a method of software debugging where a software engineer explains their code to a rubber duck or to another inanimate object. The goal is to get out of their head and verbalize the problem they are trying to solve and how they are trying to solve it, which often helps with uncovering any bugs in the code.
The Pragmatic Programmer
The basic idea behind it is as powerful as it is simple: explaining something in simple terms to others helps you see more clearly what you are trying to achieve. This concept, we believe, is applicable not only to software engineering but much more broadly.