DEV Community

Cover image for Don't Pray To The Duck
Steven Stanton
Steven Stanton

Posted on

3 2 2

Don't Pray To The Duck

I think every programmer out there has heard of rubber duck debugging. If you have not heard of it, I will cover the basics here.

I want to share with you some very important advice a co-worker gave to me when I pointed out that talking to him seemed to help more than rubber duck debugging, even though I realized what I was doing wrong while talking to him before he provided me any feedback.

That's when he introduced me to the concept: Talk to the Duck, Don't Pray to the Duck.

Something about walking through the problem verbally makes it easier to spot errors.

How to properly utilize a rubber duck

  1. Acquire a rubber duck. (Amazon Has a Great Selection)
  2. Place said rubber duck on the desk in front of you.
  3. Start Coding.
  4. When you reach a bug, explain to your rubber duck what the code is suppose to do, then go into detail and explain your code line by line.
    1. Here is the important part You must do so out loud.
    2. Remember we are talking to the rubber duck, not praying to the rubber duck.
  5. As you tell your rubber duck all about your problems, you may suddenly realize what the problem was
    1. Remember code is 10 times harder to debug than to write.
    2. Since you wrote the most clever code possible you are by definition not smart enough to debug it.
    3. The duck is beaming this information straight into your brain.

Authors Note: It HAS to be a rubber duck. No other type of object will work. I swear a rubber duck is not making me write this.

Remember, respect your rubber duck. The Duck has a PhD.

Originally published at TheSimpleDev.com

Image of Docusign

Bring your solution into Docusign. Reach over 1.6M customers.

Docusign is now extensible. Overcome challenges with disconnected products and inaccessible data by bringing your solutions into Docusign and publishing to 1.6M customers in the App Center.

Learn more

Top comments (0)

AWS Security LIVE!

Tune in for AWS Security LIVE!

Join AWS Security LIVE! for expert insights and actionable tips to protect your organization and keep security teams prepared.

Learn More

πŸ‘‹ Kindness is contagious

Discover a treasure trove of wisdom within this insightful piece, highly respected in the nurturing DEV Community enviroment. Developers, whether novice or expert, are encouraged to participate and add to our shared knowledge basin.

A simple "thank you" can illuminate someone's day. Express your appreciation in the comments section!

On DEV, sharing ideas smoothens our journey and strengthens our community ties. Learn something useful? Offering a quick thanks to the author is deeply appreciated.

Okay