Leave in your (commented out) debugging code?

Leaving in (commented out) debugging code is topic that will always be up for debate. That’s fine, there are many sides to it. But I have been finding myself quite thankful for cases where other developers have left in debugging code (commented out of course).

It just makes the debugging process a bit easier if you are unfamiliar with the code. it can be a really quick way to get the information you are after when troubleshooting. Most times, when you have such code in place it is precisely because it was difficult to troubleshoot that piece of code without it (sometimes a sign of bad code, but usually just a sign of complexity). Often what happens is that developers will create that debugging code if it isn’t there and essentially reinvent the wheel to troubleshoot anyway.

Just something to think about. One important stipulation is that the debugging code shouldn’t confuse you, and should be easily identifiable as debugging code. Also the value of such code will vary widely depending on your development platform and available debugging tools.