Lurker News
Back to discussion

Comment by weavie

weavie1 reply#
You remove the printfs when you have fixed the problem.
thaumasiotes2 replies#
It's so tempting to do this. Don't. Problems may occur again in the same area. Leave your logging statements around; configure your logging setup to skip them when you don't want them.

You're saying to delete commented-out code once the new code works. Put your code in version control instead. Logging is to once-off printfs as version control is to commented-out code.

weavie#
Not so sure. Once I get to the stage where I have to stick printfs in the problem tends to be so localized and specific that once fixed I will never need to look at that area of code in that way again.
collyw#
I do this far more than I should. The code ends up a mess after enough debugging like that.