Skip to content

Rubber Duck

You'll explain your code out loud, line by line, to someone who doesn't code, and watch the bugs show themselves.

About

Half of all bugs get found the moment you try to explain the code to someone else. That someone doesn't have to understand a word, which is why a rubber duck works. A real person works even better, because they ask the dumb question you skipped. If you can't explain a line, you don't know what it does, and that's exactly where the bug lives.

At a glance

Per requirement
15 XP
Completion bonus
75 XP
Requirements
5
Takes
One evening
Skill level
Beginner (done it a few times)
Cost
Free
Supplies
Nothing special
Where
At home
Other people
With other people

Requirements

  1. 1
    Explain a program of at least 30 lines out loud, line by line, to a duck or a person. Don't skip any lines. Say what each one does and why it's there. If you catch yourself saying 'it just does the thing', stop and work out what the thing actually is. Film at least three minutes of the explanation with the code on screen. Video
  2. 2
    Find one thing you can't explain, and look it up until you can. There's always one, whether it's a method you copied, a flag you don't understand, or a line that works for reasons you can't name. Write down what it actually does. Take a screenshot of the line with your explanation in a comment above it. Photo
  3. 3
    Explain a bug you're stuck on to someone, and note the moment you figured it out. Time how far into the explanation the answer appeared, which is usually under five minutes. If it didn't appear, the explanation was too vague, so try again with the actual values. Film a short clip of the explanation, or take a photo of a written note with the timestamp if you'd rather. Photo or video
  4. 4
    Teach one concept to a non-coder in under five minutes. What a loop is, what a variable is, or why computers need everything spelled out are all good choices. Use a kitchen or driving analogy and check that they can repeat it back to you. Film the explanation and their repeat. Video
  5. 5
    Record a two-minute walkthrough of a program for your future self. Cover what it does, how to run it, and the one weird part. Pretend you'll forget everything, because you will. Film the walkthrough with the code on screen. Video