2 ms·
I use comments far less than I once did. I spend more time writing self-documenting code. Over time, I had the experience of mine and other people's comments g
by joe_the_user 14y ago
I use comments far less than I once did. I spend more time writing self-documenting code.
Over time, I had the experience of mine and other people's comments generally being out of sync with the meaning of the code. Further, extremely complex code is too complex to fully document in the code and easy code should require no documentation. There's a middle ground but its much less than everything.
The time I once spent on comments I now spend on picking function and variable names as well as writing tests and asserts. Tests and Asserts are nice since if they stop being true, they force you to change them, unlike comments which can stay stale with no repercussions.
This isn't saying I write no comments. I write comments but a comment is intended for something unusual. That's good because that means it will get read.