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...
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:
Top comments (43)
Mine is freaky
Cow duck!! I love it!!
Duck Cow!!
Here's my rubber ducky (including piggy-masked daughter in background)
Awww, double cute!
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.
This is mine.
I've never seen a green one before! It makes me think of The Mask
I think it's an AmpelmΓ€nnchen :D
@llinaresvicent you're right. I bought this rubber duck during my trip to Berlin.
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
I lost my mind the first time I watched that comedian's bit about the ducks!
I can't wait to see your duck!
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!)
I've been wanting to get a ninja one, love it! Also the festive duck is adorable
here's my guy!
Is he a little basketball? Cute!
Also I bet that candle smells amazing
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!
Multipurpose Scrubber Ducky - for help with debugging and Clean Code:
It also makes for a nice hairdo!
Also that cup makes me very happy. I need to get one
Does paper duck count ? Hand made by a teammate to whom I explained this concept !
Absolutely it counts! As I said, I support equal opportunity debugging pals :)
By coincidence I wrote about this topic just last month. In our office we have a giant ducky to lead the pack π¦π¦π¦
Now you're giving me ideas....
In case you missed it.
I definitely want to be roommates with that guy _^