4 ms·
> The majority of comments I write are a born out of lazy coding Then you're doing it wrong. Comments can be used to describe your thinking process, an algorit
by TedDoesntTalk 6y ago
> The majority of comments I write are a born out of lazy coding
Then you're doing it wrong. Comments can be used to describe your thinking process, an algorithm, or explain esoteric code. I write comments with the target audience being people who inherit my code 5 years after I've left the project.
I'd argue that lack of comments on large projects may be an indication of an immature developer.
- boffinism 6y ago> Then you're doing it wrong. I... I think he knows that. I don't think he was ever going to say "The majority of comments I write are born out of lazy coding, so that's perfect."
- davethedevguy 6y agoYes, exactly this. The reason for writing this article is that I know I often do it wrong. I'm trying hard to make sure that the comments I do write add value to future readers of the code (including me), and are not just be a by-product of another deficiency in my coding style (such as poor variable naming, to use one example).
- pydry 6y agoI'd say that's doing it right. There are typically more effective ways of documenting code - i.e. better abstractions, naming and tests. The problem is that they are more expensive than comments. Comments are cheap and often better than nothing.