|
|
|
|
|
by spinningslate
1633 days ago
|
|
+1 for this. It also links to my #1 rule for comments: why not. It applies when: 1. There's a chunk of code that, on first reading, could be clearer/simpler/more idiomatic. 2. There's a good reason not to use the obvious approach, and do something else instead (maybe performance). Then comment to explain why the obvious path wasn't taken. No matter how well written, code alone can never explain "why not". I've found this invaluable, even looking back at my own code. |
|