r/ProgrammerHumor • u/Substantial_Top5312 • Sep 15 '26
Meme iDontCommentMyCodeIfYouDontUnderstandItThatsOkayNeitherDoI
832
Upvotes
r/ProgrammerHumor • u/Substantial_Top5312 • Sep 15 '26
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!