DEV Community

Rachel Soderberg
Rachel Soderberg

Posted on

Rubber Ducky Debugging!

When I was first introduced to the concept Rubber Duck Debugging, my eyes lit up with wonder. Ducks? At work?! What is this fantastical madness?! I imagined developers with piles of ducks surrounding them, something like this person's desk perhaps...

Duck Desk

Although a Duck Army is a bit extreme, it's not entirely uncommon to find at least one developer in any given team who has a rubber duck or three.

If you aren't familiar with this concept, you're probably wondering "What in the literal heck do rubber ducks have to do with software development?" You would be staring at me incredulously and probably chalk me up to being a loony. Well, let me explain so you can get in on the secret to some fantastic debugging productivity!

Rubber Duck Debugging, Explained

Imagine, if you will, a sneaky bug that you just cannot put your finger on. Your IDE has been less-than-helpful and you've read the suspect code top to bottom for the last 20 minutes; everything looks like it should work how you'd expect but it doesn't! You call a teammate over and ask them to hear you out for a minute. As you read through the code verbally, explaining to them every detail and decision, suddenly the bug LEAPS out at you. It was so obvious!! You probably smack your forehead, thank your coworker, they walk away chuckling at you, and you make the change that fixes the bug.

Now consider the fact that even though we love to help one another, we're all busy and have timelines to meet. What if we could mimic that "aha" moment that hits us by articulating each piece of code line by line without the human who has to stop what they're doing to listen? Enter the Duck. You can read the code to your happy little duck friend, be it a pirate, astronaut, devil, or not a duck at all (we support equal-opportunity debugging pals). Just as your coworker didn't have to say a single word, neither will your duck. The important part is reading and explaining everything as though it is actually listening - it won't work if you gloss over the details like you did in your mind the first 26 times you read it. Talk to the Duck.

Bonus Points: You can pretend your duck is at a Kindergarten comprehension level and practice explaining your code in more simple detail, a skill many developers could use some work in.

I recommend you go find yourself a duck or two! Have fun with it, find yourself a new debugging buddy!


Now a request:
If you have a duck (or ducks), show me some pictures! These are mine:
My Ducks

Top comments (43)

Collapse
 
jess profile image
Jess Lee

Mine is freaky

cowduck

Collapse
 
rachelsoderberg profile image
Rachel Soderberg

Cow duck!! I love it!!

Collapse
 
rosariopfernandes profile image
Rosário Pereira Fernandes

Duck Cow!!

Collapse
 
jonathankshay profile image
Jonathan K. Shay • Edited

My rubber duck partner (with piggy-masked daughter in background)
Here's my rubber ducky (including piggy-masked daughter in background)

Collapse
 
rachelsoderberg profile image
Rachel Soderberg

Awww, double cute!

Collapse
 
gergelypolonkai profile image
Gergely Polonkai

I'm proud to say that I'm responsible for spreading the word on RDD (Rubber Duck Debugging) in Ericsson Hungary few years ago. I left the company since then but did so in a bath of rubber ducks (not literally): there was a company hackathon during my last week where all participants got a company branded duck. I was literally in tears.

Collapse
 
rafalpienkowski profile image
Rafal Pienkowski • Edited

This is mine.

duck

Collapse
 
rachelsoderberg profile image
Rachel Soderberg

I've never seen a green one before! It makes me think of The Mask

Collapse
 
vicentdev profile image
Vicent

I think it's an Ampelmännchen :D

Thread Thread
 
rafalpienkowski profile image
Rafal Pienkowski

@llinaresvicent you're right. I bought this rubber duck during my trip to Berlin.

Collapse
 
terabytetiger profile image
Tyler V. (he/him) • Edited

I love rubber duck debugging!! At my last job, one of my co-workers referred to me as "the best rubber duck" because of how many times we would talk through some logic and find one of those "silly logic mistakes" (If anyone ever needs a human rubber duck, please reach out!).

(Will post a picture later of my duck)

Whenever I see rubber ducks I just think of this video: youtube.com/watch?v=f5d8pVg3Qtg

Collapse
 
rachelsoderberg profile image
Rachel Soderberg

I lost my mind the first time I watched that comedian's bit about the ducks!

I can't wait to see your duck!

Collapse
 
terabytetiger profile image
Tyler V. (he/him)

The Ninja duck was a gift from the previously mentioned co-worker. They brought a box full of variety ducks in for the office.

I believe my fiancée bought me the santa/reindeer duck one year for Christmas :D

(Not sure why my computer is having an issue with the upload button, so I guess Instagram it is!)

Thread Thread
 
rachelsoderberg profile image
Rachel Soderberg

I've been wanting to get a ninja one, love it! Also the festive duck is adorable

Collapse
 
desi profile image
Desi

here's my guy!

image of basketball duck

Collapse
 
rachelsoderberg profile image
Rachel Soderberg

Is he a little basketball? Cute!
Also I bet that candle smells amazing

Collapse
 
desi profile image
Desi

he is! was from when I worked at a university basketball arena.
it's heavenly and i'm so sad it's almost gone. $7 at Marshall's!

Collapse
 
mcnerdius profile image
McNerdius

Multipurpose Scrubber Ducky - for help with debugging and Clean Code:

scrubber ducky

Collapse
 
rachelsoderberg profile image
Rachel Soderberg

It also makes for a nice hairdo!
Also that cup makes me very happy. I need to get one

Collapse
 
skeudwenn profile image
Skeudwenn

Does paper duck count ? Hand made by a teammate to whom I explained this concept !

paper duck

Collapse
 
rachelsoderberg profile image
Rachel Soderberg

Absolutely it counts! As I said, I support equal opportunity debugging pals :)

Collapse
 
_bradleyt profile image
Bradley Taylor • Edited

By coincidence I wrote about this topic just last month. In our office we have a giant ducky to lead the pack 🦆🦆🦆

giant rubber duck in our office

Collapse
 
rachelsoderberg profile image
Rachel Soderberg

Now you're giving me ideas....

Collapse
 
david_j_eddy profile image
David J Eddy

In case you missed it.

Collapse
 
gergelypolonkai profile image
Gergely Polonkai

I definitely want to be roommates with that guy _^

Collapse
 
shkabo profile image
b

Does this count ? 🤔
darth duck

Collapse
 
rachelsoderberg profile image
Rachel Soderberg

Yes! Though he may be less forgiving when you find your mistake than a duck is ;)

Collapse
 
mikaleb profile image
Mikaleb

As we're not crazy enough we have to talk alone to rubber ducks ?

Collapse
 
rachelsoderberg profile image
Rachel Soderberg

Hahaha fair point!!!

Collapse
 
doubleedesign profile image
Leesa Ward

Rubber ducks are great and all, but a live cat who sits on your desk is better ;)

Collapse
 
rachelsoderberg profile image
Rachel Soderberg

I bring my bearded dragon to work on occasion, she's a hit and totally helps me debug too!

Collapse
 
kimmoli profile image
Kimmo Lindholm

Soft methods works also for hw debugging

Collapse
 
rachelsoderberg profile image
Rachel Soderberg

Is that a plushy ducky? :D

Collapse
 
kritulrathod profile image
Kritz Rathod

If that is your desk. I'ts called mob programming. ;)