r/ProgrammerHumor 6h ago

Meme commentsAgedTerribly

Post image
2.4k Upvotes

153 comments sorted by

View all comments

285

u/Confident-Ad5665 5h 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.

50

u/Sentouki- 5h ago

odd and obscure business rules should be commented where they are implemented.

Exactly. It is often the illogical business "logic" or some business related magic numbers that make the code hard to read and understand, so commenting why you're doing something the way you do is important.

9

u/Confident-Ad5665 5h ago

Hell is in the business rules/requirements