4 ms·
This doesn't really match my experience with people. You can be dogmatic about, for example, code comments - and dogmatics are not thinkers. I used to work wit
by xyzelement 6y ago
This doesn't really match my experience with people. You can be dogmatic about, for example, code comments - and dogmatics are not thinkers.
I used to work with a guy who was representative of this dogma. He'd give people a hard time if they didn't comment every line of code, and his own comments would be shit like:
if (country == "Japan) // If the country is Japan
total_cost = price // set total_cost equal to
price
else
total_cost = price + tax // Otherwise, set total_cost to price+tax
He thought this was great, and was upset when I'd tell him this is completely useless (comments don't provide any information over the code) and it's missing the one thing that would be good to actually document: why is Japan different?
People like this heard somewhere that comments are good, and thus good people write comments, and if I am a good person then by gosh I am writing comments. They don't think about utility at all.
- 29athrowaway 6y agoYour code example doesn't represent approach B). You are conflating verbosity with readability. A better example of B) in this context would be understanding that IEEE 754 floating point numbers cannot be used for currency, and perhaps adding a comment about that. Meaning, really understanding what you are doing all the way, and understanding when it works and when it doesn't.
- Gibbon1 6y agoI've come around to commenting as if I was Statler and Waldorf.