Comment Your Code with Care
medium.com
medium.com
Code without comments is very bad. There is no such thing as self documenting code. You have to consider who will be making modifications to the code after you, and that your comments sole purpose is to convey the fundamental design of your code.
document the purpose for the code, document the inputs and returns, document the algorithm steps when appropriate. Do not put a comment on every line. Just comment the unclear or potentially fuzzy bits.
also on a side note, if your code is slick and clever and requires a comment to explain it because it is complex and cryptic. You Failed!
Our life is frittered away by detail... simplify, simplify, simplify. --Henry David Thoreau
And I couldn't agree more with your sentiment regarding code that is so "slick and clever" that it requires comments. Readability is better than slick and clever any day of the week.
What's more, the articles are all the same, echoing one another with nary a new insight. The only issue of interest here is why so many developers choose this issue to redundantly blog about. Is it a starter topic to get some practice on, before advancing to other, more technical shibboleths, such as the awful inexpressiveness of statically-typed languages?
I expect articles on this topic are common because it is a problem faced by developers of any language, and the opinions on the topic actually differ quite a bit from author to author. And while I admit I am far from a seasoned veteran in tech blogging, the contentiousness of the subject made me weary about choosing it for an early topic in my blogging career. However, how and when we comment code struck me as an interesting topic that I have opinions on, and which I hadn't seen expressed in the way I attempted to say them.
My goal is to share my thoughts with other developers, so that dialogs are opened, and so that we can all benefit from openly sharing our opinions.