3 ms·
It's not about the clarity of the code though. It's about things that are uncheckable by compilers, linters, etc. That is to say, when I'm reading code I may pe
by tines 3y ago
It's not about the clarity of the code though. It's about things that are uncheckable by compilers, linters, etc. That is to say, when I'm reading code I may perfectly comprehend what the code does. But knowing what it does doesn't help me understand why it does that thing, how it fits into the overall design, and things of that nature.
For example, if code is operating on a list, and then it sorts that list and passes it along to some other code, I can see perfectly that the list will be sorted. But that doesn't tell me _why_ it needed to be sorted in the first place. Often that is not knowable except by reviewing things outside the scope of the code in question, or outside any code at all. A comment is essential in that context.