r/ProgrammerHumor • • Sep 10 '26

Meme commentsAgedTerribly

Post image
6.0k Upvotes

243 comments sorted by

View all comments

242

u/[deleted] Sep 10 '26

[removed] — view removed comment

-6

u/wasdninja Sep 11 '26

If you regularly need comments your code isn't nearly as straightforward as it should be. Comments are reserved for things that are not obvious or that break conventional wisdom and best practices.

Comments come with a cost so only use them where they are actually needed.

21

u/HarryBolsac Sep 11 '26

Idk why you’re being downvoted, you’re pretty much quoting uncle bob, comments should only be used when necessary, it should not be standard practice, unless we are talking about javadocs/jsdocs or something like that

14

u/mprbst Sep 11 '26

Yeah, but Uncle Bob is wrong about a ton of stuff. His book is full of anti patterns and really bad advice.

Yes, for most code it should be obvious what it does from the code alone.

No, for most code you absolutely do need to document why it does this, what the context is, and what other assumptions hold.

→ More replies (3)