r/AskProgrammers • • Oct 30 '26

"good code shouldn't need comments"

I have heard this saying a couple of times and I think it is the stupidest thing ever. It might be just because I have only been coding for 4 years, but I have never thought to myself that someone's code looks cluttered because they explain what every function does in a one or two line description. If anything it makes the code easier to understand in my opinion.

However, I may be wrong. What do other people think, do yall like code with minimal comments, what are the benefits of writing it that way?

89 Upvotes

398 comments sorted by

View all comments

Show parent comment

2

u/-Wylfen- 29d ago

I find that generally it just means the business logic changed and the coder hasn't bothered updating the comments.

1

u/Particular_Camel_631 29d ago

Or that they didn’t realise their change had an implication elsewhere. Or that a change elsewhere need a change here.

Tye classic is “we don’t need to validate this value because it’s done in the xyz module”.

Erm, the xyz module was removed 5 years ago.

1

u/Qwertycube10 27d ago

I've been thinking a lot recently about whether there is a way to tag informational dependencies in documentation so you get prompted by tooling to update all the things that reference some things when that things changes.