Rubber duck debugging is a method programmers can use to debugging code. It will help you stick to your goal and solve the task at hand.
The practice of rubber ducking comes from the book: The pragmatic programmer by Andrew Hunt and David Thomas.
The rubber duck Method
- Get a hold of a rubber duck
- Place the duck on your desk and start bonding with it. Talk to it, give it a name, and so on.
- Go over the code you have trouble writing and explain it in detail, line by line, out load to the duck.
- At some point during the talk, the duck will help you come further with your code, and you will get a so-called "eureka moment" :)
My rubber duck
I acquired a duck a few weeks ago. We talked and talked throughout the night, then suddenly I came up with the name: Darkwing for him. He's a little shy, but I managed to get a photo of him.
Do you have a rubber duck on your desk?