Friday, February 12, 2010

Commenting old code is useless

Why do people comment out old code ?

There is your favorite SCM for tracking the changes that happened in the particular piece of code.
So why ?
Because people are afraid of the change, afraid of breaking something.
They comment out the old code, so that if something happened during the Big Testing Phase, they could revert.

Commented code means no code coverage, i.e. no unit test.
Commented code should be added as one of the code quality indicator (or technical debt management) like Sonar, because it smells like something not right is going on.

No comments: