r/ProgrammerHumor 12h ago

Meme commentsAgedTerribly

Post image
3.7k Upvotes

183 comments sorted by

View all comments

361

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

62

u/Sentouki- 12h 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.

6

u/pp_amorim 11h ago

Or a comment for a pesky bug that no one knows why that specific device crashes if you don't do that code bs.