Eliminate Useless Comments

Be careful what you ask for.   I was reviewing some code that had absolutely no comments. I asked the developer to add some comment.   So, indeed they did, however the comments added no value to the code at all.   There is no point in adding comments for comments’ sake.  In fact, useless comments make the code worse by adding lines without adding value.   Let’s talk about what a valuable comment is. Continue reading

Context Error Reporting

One of the biggest mistakes I see programmers make when writing an error message is to forget to include details about the context into the message.  The message effectively “assumes” that the reader knows the context, but that assumption is not always valid, and the error message can fail communicate. Continue reading