3 ms·
You remove the printfs when you have fixed the problem.
by weavie 11y ago
You remove the printfs when you have fixed the problem.
- thaumasiotes 11y agoIt'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 11y agoNot 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 11y agoI do this far more than I should. The code ends up a mess after enough debugging like that.