The Danger of Commenting Out Code

“The Broken Window Theory proposes the idea that if we do one bad thing in our code (i.e. break a window) then it becomes more likely that the next person who encounters that code will do something bad as well eventually leading to the degeneration of the code.

This is the same when commenting out code – if people see that there is code commented out then it becomes more acceptable for them to also comment out code and before you know it there are large chunks of code commented out and no one really knows why.”

From Mark Needham. As Mark notes, and a commenter amplifies, source control makes code comments obsolete. You have a backup of prior code in the code repository and you can revert to the prior code if your new code fails.

    blog comments powered by Disqus

    Connect With Us Online

    We provide low-cost, how-to internet marketing information for individuals, businesses, and groups, as well as the people who support them. Learn more

    • Popular Articles
    • Latest Stories
    • Popular Stories

    Great Online Communities to Explore

    Get the Email Newsletter: Keep Up To Date