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.

Add Your Comment

If you comment to get a link back to your site, that's fine, but please add a comment that expands what is written in the story above. Make your comment personal, share your experience, ask a question. Thank you!

You must be logged in to post a comment.

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

  • Latest Stories
  • Popular Articles
  • Popular Stories

Great Online Communities to Explore

Get the Email Newsletter: Keep Up To Date