3 ms·
You make a good point about why vs. what. Still, my experience has been that if I ask myself when adding a comment, "Could I make the code say this instead?" th
by gruseom 17y ago
You make a good point about why vs. what. Still, my experience has been that if I ask myself when adding a comment, "Could I make the code say this instead?" the answer is "yes" 9 times out of 10. It is preferable to do so because code is much likelier to be read and maintained than comments are. Also, this question often makes me see flaws in how the code was expressing itself, so I end up with better code.
- Retric 17y agoI think the best comment is one which explains an ugly edge case which forces the code to look like it does. //window.update; is not used because of API bug #12345 see: bugs.mysql.com/12345 so use xyz instead. Nine times out of ten I can read and understand good code with little effort, but code often starts out looking clean and becomes messy for a reason.