Article 5ASJ9 CodeSOD: Production Comments

CodeSOD: Production Comments

by
Remy Porter
from The Daily WTF on (#5ASJ9)

A fair bit of "bad code" requires at least a passing understanding of the language in question, or the domain involved. But bad comments transcend programming languages. Vilx sends us this one, which comes from code which is definitely running in production.

// WARNING!!! Special case for [external API] testing.// DO NOT LET THIS PIECE OF CODE FIND IT'S WAY TO PRODUCTION

Adding more commentary almost feels like gilding the lilly. Almost.

One of the main objections to putting loads of comments in your code is that over time the code changes, and if the comments don't change with them, confusion results. Which, not only is this not a comment you want to see in your production code, it's not an accurate comment. Vilx explains:

In all truth the particular code (or even the codebase) isn't all that bad; and the lines that followed are completely harmless in production...

buildmaster-icon.png [Advertisement] Utilize BuildMaster to release your software with confidence, at the pace your business demands. Download today! TheDailyWtf?d=yIl2AUoC8zALEQcl8exARU
External Content
Source RSS or Atom Feed
Feed Location http://syndication.thedailywtf.com/TheDailyWtf
Feed Title The Daily WTF
Feed Link http://thedailywtf.com/
Reply 0 comments