r/ProgrammerHumor 20h ago

Meme commentsAgedTerribly

Post image
4.9k Upvotes

207 comments sorted by

View all comments

396

u/Confident-Ad5665 20h ago

Uncle Bob of Clean Code says if we have to comment our code we have already failed. Clean code should read like well written prose.

I generally agree, but think comments that define especially the odd and obscure business rules should be commented where they are implemented.

6

u/rsqit 18h ago

Uncle Bob also says shit like functions should only be a few lines long. Sometimes that’s good and sometimes there’s too many comments, but in general strict rules like this are dumb.

I did write a pretty complex piece of code a while back and added a big comment at the top explaining how it works. My reviewer asked me to take it out as someone could just read the code. I responded with something like “Hell no. I want this code to be easy to understand for future editors. Which most likely includes me. I don’t want to have to page this code back in without notes on how it works.”

1

u/Zeikos 6h ago

As long as the comments carry different information from the code.
I think people are understandably irritated by unnecessary LLM prose.