← Table of Contents

Rubber Duck Debugging / 1 of 5 / 1 views

What Is Rubber Duck Debugging ?

What Is Rubber Duck Debugging, and Why It's Not Just a Junior Developer Thing

Ever been stuck on a bug, started explaining it out loud to a teammate, and halfway through the second sentence you suddenly go "wait, I think I know what's wrong"? Your teammate hasn't even said anything yet.

That's Rubber Duck Debugging in a nutshell.

Stuck alone → Explain it to the duck, step by step → The answer clicks (before the duck ever "answers")

Where the Name Comes From

The term comes from a habit some developers picked up: keeping a rubber duck on their desk and explaining their code to it, line by line, as if the duck actually understood. It sounds silly, but the effect is real. Explaining something out loud, in complete sentences instead of half-formed thoughts, forces your brain to organize its logic in order. A surprising number of bugs turn out to be less about missing knowledge and more about an assumption that was never actually stated out loud.

Why It Works

When we debug silently in our heads, our thinking tends to jump around: see the error, suspect one part of the code, tweak it, run it again, repeat — often without ever really checking whether that suspicion was grounded in anything. The moment we're forced to explain the problem to someone (or something) else, we're implicitly required to:

  • State what was supposed to happen.
  • State what actually happened.
  • Walk through the flow step by step.
  • Point to evidence, not just a hunch.

That process alone is often enough to expose a wrong assumption, long before the conversation even gets to "can you help me with this."

Why This Isn't Just a Beginner Skill

There's a common assumption that Rubber Duck Debugging is basically a training-wheels technique — something junior developers use so they stop bothering their seniors so often. That framing misses the point.

After years working on Android projects running on non-standard hardware — set-top boxes, Android boxes, Android TV devices with wildly different behavior across vendors — I actually reach for this technique more often, not less. The more complex the system, the higher the chance of misdiagnosing the root cause early on.

A real example: a report came in that video playback would randomly stop after running for a few hours, but only on some devices. The obvious instinct was to blame ExoPlayer, since it's the most visible component. But once I forced myself to walk through the flow in order — where the content came from, how caching worked, how player state was managed while the device sat idle for a long stretch — the actual problem turned out to live well before ExoPlayer was even involved. If I'd jumped straight to a fix without going through that "explain it from the start" step, I would almost certainly have spent time fixing something that was never broken.

That's the part people miss: senior engineers don't get confused less often. They're just better trained at holding off on conclusions until there's evidence. Rubber Duck Debugging is one of the cheapest ways to build that habit — no extra tooling, no one else required, just the discipline to honestly explain the problem to yourself (or to a rubber duck, if that makes it easier).

A simpler but very common example: a bug report says "the refresh button doesn't work." Taken at face value, a developer can burn hours staring at the OnClickListener, when walking through it in order — "what happens right after the button is tapped, then what happens after that, then after that" — reveals the listener fires just fine. The function it calls silently fails because of an exception swallowed by an empty try-catch block. Without that step-by-step explanation, "the button doesn't work" keeps getting treated as fact, when it was only ever a surface-level symptom.

How to Actually Start Doing This

You don't need to go buy an actual rubber duck. A few approaches work just as well:

  • Write it out in a notes app, as if explaining it to someone else, in full sentences — not just keywords.
  • Draft a message to a teammate, but don't send it yet. More often than not, the answer shows up before you even hit send.
  • Record yourself talking through the code flow, then play it back — you'll often catch a part you quietly skipped over while explaining out loud.
  • An actual rubber duck still works fine if that's what makes talking out loud feel less awkward.

The medium doesn't matter. What matters is the discipline to explain things completely and honestly — including admitting which parts you haven't actually verified yet, not just the parts already backed by evidence.

Where This Series Is Headed

This is the opening piece in a series on systematic debugging for Android development — covering a framework for structuring a bug report, how to actually read Logcat and stack traces, and specific cases like broken pagination, a RecyclerView that mysteriously stays empty, or a WebSocket that won't reconnect cleanly.

Next up: a 9-step framework for structuring the debugging process itself — from a simple "context" all the way to a genuinely specific "question," whether you're asking it of yourself, a teammate, or the duck sitting on your desk.