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 …


This content originally appeared on DEV Community and was authored by Steven Stanton

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


This content originally appeared on DEV Community and was authored by Steven Stanton


Print Share Comment Cite Upload Translate Updates
APA

Steven Stanton | Sciencx (2024-06-29T21:37:08+00:00) Don’t Pray To The Duck. Retrieved from https://www.scien.cx/2024/06/29/dont-pray-to-the-duck/

MLA
" » Don’t Pray To The Duck." Steven Stanton | Sciencx - Saturday June 29, 2024, https://www.scien.cx/2024/06/29/dont-pray-to-the-duck/
HARVARD
Steven Stanton | Sciencx Saturday June 29, 2024 » Don’t Pray To The Duck., viewed ,<https://www.scien.cx/2024/06/29/dont-pray-to-the-duck/>
VANCOUVER
Steven Stanton | Sciencx - » Don’t Pray To The Duck. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2024/06/29/dont-pray-to-the-duck/
CHICAGO
" » Don’t Pray To The Duck." Steven Stanton | Sciencx - Accessed . https://www.scien.cx/2024/06/29/dont-pray-to-the-duck/
IEEE
" » Don’t Pray To The Duck." Steven Stanton | Sciencx [Online]. Available: https://www.scien.cx/2024/06/29/dont-pray-to-the-duck/. [Accessed: ]
rf:citation
» Don’t Pray To The Duck | Steven Stanton | Sciencx | https://www.scien.cx/2024/06/29/dont-pray-to-the-duck/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.