News for hackers. Stuff that matters.
Re:Some things I've learnt about programming by Xion on Thursday July 12, 2012 @06:17AM (#4233857)
Sometimes the logging is not enough, and you cannot isolate the case to prepare appropriate unit test.

Just few days ago I had a strange problem with the order of imports in Python at the border of my code and external library (Celery). There were import hooks involved but they didn't seem to be executed properly in certain conditions. I could reproduce them quite reliably but I needed to pinpoint the exact import (inside Celery itself, mind you) that was causing the problem. pdb (Python debugger) was indispensable while solving it.

On the other hand, though, it was probably the first time in many months that I used pdb for more than 5 minutes, and for something more complicated than checking why a particular test fails.

Re:Some things I've learnt about programming by StavrosK on Thursday July 12, 2012 @07:45AM (#4234073)
I agree, you certainly have to trace execution flow somehow, and a debugger is the best way to do that. However, my realization was more that the debugger wasn't useful for the vast majority of cases. Until now, I somehow thought I used a debugger a lot, and that it was a big part of my debugging (after all, how do you debug without a debugger?).

This post made me realize that 95% of the time I fix errors from just the stack trace, 4.9% from logging, and 0.1% from actually debugging.

Re:Some things I've learnt about programming by lifeisstillgood on Thursday July 12, 2012 @06:59AM (#4233956)
Thats my experience as well - I rarely use a debugger, but when I do I cannot imagine any other way of finding out what is going on.