Should debugging code be left in place? -


is leaving debugging code in place discouraged practice?

for example, program (written in java) i'm working on can send emails. there various ways emails failed send handled. in method send in email class, pass boolean argument boolean fail which, if true, causes method fail. allows me test whether emails failed send correctly handled.

i have other instances of throughout program well. obviously, in final production code program told fail. there harm in leaving these debugging tools in place in case corresponding features ever need changed?

rather commenting or uncommenting debugging logic, if can set debugging run based on environment variable, leaving in place practice. come in handy (or else) down road. in future you'd simple set debugging true see debugging logic, , in production, you'd set false.


Comments

Popular posts from this blog

php - Zend Framework / Skeleton-Application / Composer install issue -

c# - Better 64-bit byte array hash -

python - PyCharm Type error Message -