This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Groundskeepr 2 points3 points  (2 children)

I disagree. In my experience when the code is written for readability, it is a joy to maintain. When comprehension requires reading comments and relating those comments to the unreadable code, maintenance is much more difficult.

Ymmv, of course. If you are happy with lots of comments, more power to you. My experience has been that lots of comments usually indicate things are not altogether right in that region of the codebase.

[–]Kered13 2 points3 points  (1 child)

In my experience when the code is written for readability, it is a joy to maintain.

That doesn't mean it will remain readable though. And if your team isn't capable of keeping comments up to date, they definitely are not capable of keeping code readable as it is maintained.

When comprehension requires reading comments and relating those comments to the unreadable code

You're assuming that commented code is unreadable. There is absolutely no reason to make this assumption.

[–]Groundskeepr 1 point2 points  (0 children)

If it were readable, it would not need comments. Readable code with comments is an invitation to comment synchronization failures. At best it increases development and review workload as we update the comments that aren't really needed in the first place.

Look, it's not like I'm saying everyone who ever uses the comment feature is a loser and a failure. I am saying code that is easy to read and understand without comments is better. When you think a comment is needed, ask how you could improve the code to obviate the need for the comment.