Not logged in
Log in now
Create an account
Subscribe to LWN
LWN.net Weekly Edition for May 16, 2013
A look at the PyPy 2.0 release
PostgreSQL 9.3 beta: Federated databases and more
LWN.net Weekly Edition for May 9, 2013
(Nearly) full tickless operation in 3.10
It's also why "check your assumptions" is the first rule of debugging I teach to new coders. :)
How to ruin Linus's vacation
Posted Jul 20, 2011 2:44 UTC (Wed) by jzbiciak (✭ supporter ✭, #5246)
This is also why I find debugging with print and assert statements to be much more helpful than single stepping, in the vast majority of cases. Single stepping was more useful to me when I didn't necessarily understand all the language constructs. That was 20-25 years ago, though.
Nowadays, if I have some weird bug, it's because something I think is true is not, or some other "invisible-to-me" error. A judiciously placed print statement (perhaps guarded by an 'if' to filter out the noise) makes it easy for me to prove or disprove my assumptions about what's happening in the code, though, without disrupting any of the code around it. I can compare working cases to non-working cases easily and in a batch-wise manner after the fact. Very useful.
Posted Jul 21, 2011 19:19 UTC (Thu) by nas (subscriber, #17)
Posted Jul 22, 2011 19:58 UTC (Fri) by smurf (subscriber, #17840)
Please enlighten us what this test means; not everybody is damiliar with the idiom.
Posted Jul 23, 2011 9:45 UTC (Sat) by smurf (subscriber, #17840)
Posted Jul 23, 2011 21:38 UTC (Sat) by neilbrown (subscriber, #359)
Pick the wikipedia link on Rubber Duck Debugging.
Posted Jul 25, 2011 18:08 UTC (Mon) by Lennie (subscriber, #49641)
I presume the name comes from working late because you can not figure out a problem. Then the janitor comes and he can sees you are kind of frustrated and asks what the problem is.
You try to explain it to the janitor in simple terms and then you understand your problem and can fix it.
Then you go home happy I guess.
The ducky is just a way to try and induce that state of mind with an inanimate object where you are trying to explain the problem to someone else in simple terms.
Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds