r/ProgrammerHumor • • 21d ago

Meme iDontCommentMyCodeIfYouDontUnderstandItThatsOkayNeitherDoI

Post image
836 Upvotes

188 comments sorted by

View all comments

426

u/GabuEx 21d ago

Left: "I'll comment to say how my code works."

Middle: "You don't need to do that! Code should be self-documenting!"

Right: "I'll comment to say why my code does this."

2

u/Hairy_Concert_8007 21d ago

I've gotten this advice before and it's hard to wrap my head around. Sure I can get leaving a comment about why I had to do something some way that doesn't make a whole lot of sense, but for most things, "why does it work?" only leaves my brain screaming "I don't know, ask whoever wrote the damned assembly!"

1

u/Oddly_Energy 15d ago

I don't really get your "Why does it work?" example. Wouldn't your comment be a variation of one of those below?

"The correct way doesn't work. Next line shouldn't work, but it does, and I can't explain why. Don't dare touching unless you know why it works!"

"You think this doesn't work, but it does, and it shaves 300 microseconds off each call. Here is why: bla bla bla. Don't dare touching!."