Is it bad practice to leave commented-out code in production releases

I regularly see production code from developers (large companies and individuals) that contains code that has been commented out. Presumably this removes earlier attempts at achieving the functionality that didn't work for some reason.

To my mind, this is messy, but potentially has some benefits e.g. on returning to refactor or extend the code, the developer can see what has been tried previously.

Are there any security or best-practice aspects to this?

13
задан Jonathan Day 8 September 2010 в 02:42
поделиться