3 Common Kinds of Unnecessary Code Comments: Nickleus Jimenez August 2020
3 Common Kinds of Unnecessary Code Comments: Nickleus Jimenez August 2020
Nickleus Jimenez
August 2020
1 Introduction
This is a listing of complaints of comments on code. Comments are needed from time to time but
great programmers make code that humans can read. Comments being needed is usually a bad sign.
Some comments are last resort in explaining convoluted code or algorithm. The times when they
are not a bad sign are legal disclaimers, ownership and design patterns reference. The times they
are frustrating as when they are used to chronicling comments history, show TODO that never gets
started and comments that are already explained in code There are other frustrating comments such
as misleading ones but those 3 will be the focus here.
4 Redundant Comments
Redundancy of comments is not limited to comments that have the same meaning as a previous com-
ment and excessive repeated explanation. It also includes comments that are better explained in code
like methods/functions/subroutines variables whose names should indicate its purpose. Commenting
”Gets the surname of person” of method ’GetSurname(Person givenPerson)’ looks so redundant when
the name of the method and parameters explains itself as it should. It is better to explain in code or
1
make code more understandable to the point of comments not being needed to explain other developers
what is going on. Exposition comments should be last resort of explaining intent. Complicated algo-
rithms or routines are still possible and explanatory comments are for that. These kinds of comments
are common in projects where mandating comments trumps over making readable code.
5 Conclusion
These 3 are common bad or improper comments seen in professional source codes. Some of these
can be symptoms of inadequate tools, pointless process or excessively lenient code review. Note that
comments is not the only way to evaluate code. Commenting is something that is needed but not that
well thought of which can eventually lead of misunderstandings and junk information like all other
bad documentation practices. So avoid those practices with having source control, setting deadlines
for To Do comments , finish ”TODO” before code review and make code as readable as possible before
thinking about explaining with comments.