3 ms·
I hardly ever write comments for code I write. My philosophy, which I took from Uncle Bob, is if code is so complex it needs commenting at a statement or method
by jogjayr 9y ago
I hardly ever write comments for code I write. My philosophy, which I took from Uncle Bob, is if code is so complex it needs commenting at a statement or method level then it's too complex. Simplify the logic, put complex clauses or statements into meaningfully-named functions (which you can test too, so win-win). But don't rely on comments to explain your code. Your code should explain your code.
Only "overview" comment blocks for entire files, which describe the overall purpose of the class or module, are useful to me and my team.[1]
1. https://softwareengineering.stackexchange.com/questions/285787/clean-code-comments-vs-class-documentation https://softwareengineering.stackexchange.com/questions/2857...