Work Management

Rubber Duck Method

The rubber duck method explained: why talking through your code line by line, even to a toy duck, helps you spot bugs, how to do it and when it works best.

  • 6 min read
  • 5 questions
  • +35 XP
Transcript

The Rubber Duck Method, explained by cats. Kitty has a bug. The code doesn’t work. She’s stuck. She stares at the screen. Runs the code again. Still broken. So Kitty grabs… a rubber duck. Yes. A duck. Kitty explains the code.

“First I fetch the tuna.” “Then I process the tuna.” “Then I save the tuna.” The duck says nothing. Just stares. Judging silently. Kitty keeps explaining. “Then this function runs…” “…and then this function—” Kitty stops. “Wait.” “Why am I calling this twice?”

Bug found. The duck still says nothing. Because it’s a duck. That’s the Rubber Duck Method. Explaining the code forces Kitty to slow down. Think clearly. Notice mistakes. The duck doesn’t fix the bug. But somehow… the duck always helps.