2 ms·
While it is true that when some idea can be expressed by descriptive variable or function name, comment is not necessary. But there are many places in the code
by greyman 18y ago
While it is true that when some idea can be expressed by descriptive variable or function name, comment is not necessary.
But there are many places in the code, where it is highly desirable to explain by plain words, why certain solution was adopted, that certain part is a bug fix, or why some part of the code is counter-intuitive. I for one am much more happier when my colleagues comment their code extensively.
To look at it from the opposite side: Is there any inherent problem with having too much comments? (provided they are correct).
- stcredzero 18y agoIf you can't write intention revealing code, this often is a symptom! Most often this means that there are implicit rules written into your code base. 90% of the time or more these should be factored out! Also, another problem with too many comments: this is more stuff to maintain. Chances are, the programmer already has enough to do!