CodeSOD: Comments, Documentation, and Nulls

This post was originally published on this site

The Daily WTF

Ah, the joy of comments. Good comments can illuminate complicated code, explain a programmer’s reasoning, or even just do their best to absolve a burned out programmer of their sins. “Yes, it’s bad, but it works.”

Then there’s this comment, sent to us by Mark B. This is from a configuration file format, “helpfully” explaining what the flag does.

// [true, false] if this is true the provided credentials will be encrypted i.e. the provided credentials will not be encrypted

Now, the developer clearly meant “if true, we encrypt, if false, we don’t”, but clearly didn’t understand what “i.e.” means (“that means”, or “that is to say”, or “in other words”), creating a WTF for grammarians everywhere, and a headscratcher for the developer reading this for the first time.

While we’re picking on documentation, let’s pick on someone our own size, or maybe a little larger. Let’s pick on

To read the full article click on the 'post' link at the top.