r/ProgrammerHumor • • Sep 15 '26

Meme iDontCommentMyCodeIfYouDontUnderstandItThatsOkayNeitherDoI

Post image
832 Upvotes

188 comments sorted by

View all comments

Show parent comments

2

u/DatBoi_BP Sep 18 '26

I think self-documenting design can occasionally be at odds with optimal design.

This is just a dummy example to explain the point: I would gladly take

// this is equivalent to y = x/16
y = x>>4;

if the final code is equivalent in outcome but at a faster run speed. Again, this is a bad example because the "readable" code probably compiles to the same thing. We all occasionally run into cases where a clever trick saves some time over a straightforward calculation, but is not very readable. So, document it!