Rubber Ducking

Rubber Ducking #

Explain your code to an inanimate object out loud and line by line.

Verbalizing logic forces you to slow down and often reveals bugs you missed while reading silently.

Not just for debugging

Works before code exists:

  1. Planning: explain the problem and your intended solution

  2. Designing: narrate architectural decisions

  3. Pseudocode: verbalize logic while drafting algorithms with comments.

  4. Testing: explain the “why” behind each test case

Benefits

  • Helps to clarify ideas and identify unknowns.

  • Provides a structure that allows to break down problems.

  • Helps to formulate efficient LLM queries.

  • Provides (more than) the necessary comments to understand the resulting code.

Variation: Write down with pen on paper the pseudo code and logic.