🛠️Rubber Duck Debugging
Also known as Rubber Ducking, Rubber Duck Method, Duck Debugging
You say your code out loud, line by line. Then you spot the mistake.
Think of it like
It is like telling a friend how a game works. Halfway through, you spot the rule you got wrong.
Example
Mia is stuck on a loop that skips the last item. She explains it to the duck on her desk. When she says it stops before the length minus one, she hears the mistake.
Why it matters
It finds many bugs in minutes, with no tool and no need to wait for a colleague.
Definition
Common mistake
Key takeaways
- 1Out loud. Speaking slows you down.
- 2Every line. Skip nothing, even the easy parts.
- 3Any listener. A duck, a pet or a note.