CodeSOD: John Told Us

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.

[Advertisement] BuildMaster allows you to create a self-service release management platform that allows different teams to manage their applications. Explore how!

This post originally appeared on The Daily WTF.

Leave a Reply

Your email address will not be published. Required fields are marked *