Wednesday, March 11, 2009

De-bug-ging

Seemingly, with nothing original that I can think of myself, I am finding lots of things I find here and there pretty interesting. Especially this one on some mailing list that I found via reddit, which describes one of the best ways of debugging ;)

We called it the Rubber Duck method of debugging. It goes like this:

1) Beg, borrow, steal, buy, fabricate or otherwise obtain a rubber duck
(bathtub variety)
2) Place rubber duck on desk and inform it you are just going to go over
some code with it, if that's all right.
3) Explain to the duck what you code is supposed to do, and then go into
detail and explain things line by line
4) At some point you will tell the duck what you are doing next and then
realise that that is not in fact what you are actually doing. The duck
will sit there serenely, happy in the knowledge that it has helped you
on your way.

Works every time.

To think of it, I missed an opportunity to use my cat more effectively ;)

2 Comments:

OpenID srao said...

To think how the cat would have reacted :))

Wednesday, March 11, 2009 2:04:00 pm  
Blogger xoddam said...

I once had the honour of using Richard Heathfield in place of the duck. Though he described the role as that of a teddy bear.

Thursday, March 31, 2011 8:28:00 am  

Post a Comment

<< Home