DEV Community

Cover image for What is Rubber Duck Debugging?
Joe Eames for Thinkster

Posted on

2

What is Rubber Duck Debugging?

You’ve been banging your head against a virtual wall for what seems like a month, and you are no closer to getting your code to actually do what it’s supposed to do. What now? Perhaps a new career? Something less frustrating like crash test dummy sounds pretty good all of a sudden.

Ok, you take a quick breath and realize that maybe you can get help from a coworker. Someone to come look at your code with you and help you find the problem. That is actually a proven recipe for success. Just the act of explaining in clear terms what you’re trying to accomplish in your code will lead to you discovering the problem, and the other person often doesn’t even need to really participate, they just need to listen.

Only what do you do if you work alone? Or it’s late at night and nobody else is with you? Or your only coworker is on vacation following the Grateful Dead around on tour?

There is another solution, that is proven to be 83.29% as effective as an actual human. And that is the rubber duck.

image

Yes, pull out your trusty rubber duck and set him/her/them/it on your desk and proceed to explain your code and how it works to Mr. Ducklesworth.

If you’ve never been exposed to this technique it can sound dumb, and even thinking about doing it may make you feel silly, but what is your priority? Looking as cool as David Hasselhoff or getting your code into production?

Don’t believe me? Here’s a great writeup on the psychology of rubber duck debugging.

So get your favorite artificial waterfowl, keep him handy, and when necessary, lay out your technical problems on his very capable and water-proof shoulders.

Happy coding!

Signup for my newsletter here.

Visit Us: thinkster.io | Facebook: @gothinkster | Twitter: @gothinkster

Sentry blog image

How to reduce TTFB

In the past few years in the web dev world, we’ve seen a significant push towards rendering our websites on the server. Doing so is better for SEO and performs better on low-powered devices, but one thing we had to sacrifice is TTFB.

In this article, we’ll see how we can identify what makes our TTFB high so we can fix it.

Read more

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay