r/ProgrammerHumor • • Sep 15 '26

Meme iDontCommentMyCodeIfYouDontUnderstandItThatsOkayNeitherDoI

Post image
832 Upvotes

188 comments sorted by

View all comments

Show parent comment

3

u/Just_Information334 Sep 15 '26

Yup. If you only ever touch new code you may not understand why it is necessary.

Go on some 10+ yo project which got a lot of scope changes over the years. Now you can see that yes, the code does something. But why? Is it still useful? Can you remove it? If you do, will some client come complaining 6 months from now when their very specific report is not generated because some flag is not set correctly so some cron running on a server no one knows about anymore did not find its data?

The documentation? Maybe in some .doc file rotting on an archive server. But if you can't find it you may have more luck finding the printed version which should be in room 6. If it was not binned during the last office move.

On the other hand, let's check postgres code by opening a random file: https://github.com/postgres/postgres/blob/master/src/backend/partitioning/partprune.c

If you praise tailwind for the locality of behavior it gives, then you should also want why-comments next to the related code.

2

u/EspaaValorum Sep 16 '26

That random code - lovely, like a senior dev explaining stuff to a junior dev. Imagine those comments not being there, and needing to onboard a new dev. The existing devs would need to spend a ton of time explaining things. I've seen that happen on poorly or not documented code bases, making it very difficult to expand the team with new devs because it takes away time from the already strained senior dev.

1

u/Oddly_Energy Sep 21 '26

> Maybe in some .doc file rotting on an archive server.

in the bottom of a locked filing cabinet stuck in a disused lavatory with a sign on the door saying 'Beware of the Leopard.'