Article 6DXTE CodeSOD: John Told Us

CodeSOD: John Told Us

by
Remy Porter
from The Daily WTF on (#6DXTE)

Comments are an important part of making code comprehensible to other people, especially when they explain the why- linking lines of code to requirements, specification documents, etc. Karl used to work for a large company that maybe didn't see comments that way.

So, for example, when you see a line of code like this:

VideoTitle = store.Region

You might be left wondering: why is VideoTitle storing that value? And in an ideal world, maybe a comment would reference the requirement.

Or, for Karl's team, it might be something more like this:

// John told us that video title comes from the store region field.

Most of the comments were something along the lines of "John told us". Unfortunately, John worked there a long time ago, and no one currently working there knew who John was, or why he told people to do the things they did.

At least there were comments.

buildmaster-icon.png [Advertisement] BuildMaster allows you to create a self-service release management platform that allows different teams to manage their applications. Explore how!
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