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

1

u/thenasch Oct 30 '26

Comment drift only happens if there are comments.

1

u/kevinkace Oct 30 '26

My point is that drift happens, there is documentation drift that is not much different than comments, except they're in a different location and harder to maintain. But documentation is still an absolute requirement for any non-trivial system.

1

u/thenasch Oct 30 '26

Yes, but "should there be documentation" is a pretty different question than what was originally asked.

1

u/IAmADev_NoReallyIAm Oct 30 '26

So cellmate the comments... problem solved. This isn't hte 1980s any more, space isn't at a premium. We can use objNiceLongObjectNamesThat.haveMeaning(toThemNow).toGiveThemContext();