3 ms·
I'll go further. Comments are a code smell. They mean you've probably not modularized your code enough, or named your functions and variables descriptively enou
by EGreg 4y ago
I'll go further. Comments are a code smell. They mean you've probably not modularized your code enough, or named your functions and variables descriptively enough. As I've approached 20 years of coding, I began to be able to count on one hand the times when I truly need to add a comment.
(I don't mean the DocBlock type comments for describing functions and class interfaces, that get compiled into docs.)
To all you downvoters: please do respond with examples of comments that are are counterexamples to what I said!
- deleted 4y ago[deleted]
- adgjlsfhk1 4y agoin non performance critical code, comments usually aren't necessary but they are godsends when you need to do something tricky for performance. standard examples are things like bithacks.