Rubber Duck Debugging

in #programming8 years ago

How many times have you battled with a piece of code. You then go to a colleague and start to explain the problem but part way through you have that "I am so stupid, I know what is causing it now" moment. This is normally caused by a mismatch in what you think the code is doing and what it is actually doing. The act of explaining is normally enough to trigger that "ah!" moment where you spot the problem.

Rubber duck debugging is where you replace the colleague with some inanimate object, such as a rubber duck. As you can see from the image, my rubber duck is a 3D crystal skull puzzle.

Alas poor Yorick :)

Simply explain to your "rubber duck" what the code is expected to do and then start to explain how it does it. Far more helpful than you would expect, saved me a few times.

A vital part of your coding tools so go grab yourself your own "rubber duck" and have a happier coding experience.

Do you already do this? If so what is your "rubber duck"?

Woz

Sort:  

As a long time Perl programmer I can relate totally to this. As a hacker I have to do this 10 to one with other people's code before it becomes mine. The joy of open source. Now I have to figure out how to incorporate steemit into the code. No rubber duck I just talked to myself.

I wonder if talking to yourself looks worse than talking to a skull you are holding in your hand rotf

Only to the unintelligent. Not that I care I am usually alone when I program.

lol true

That is part of programming though. Even when in the office I am in my own world in my head

Coin Marketplace

STEEM 0.13
TRX 0.34
JST 0.034
BTC 110671.84
ETH 4371.84
SBD 0.83