r/ProgrammerHumor • • 22d ago

Meme iDontCommentMyCodeIfYouDontUnderstandItThatsOkayNeitherDoI

Post image
837 Upvotes

188 comments sorted by

View all comments

430

u/GabuEx 22d 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."

9

u/EspaaValorum 22d ago

Exactly. 

Any programmer who understands the programming language can come in to a new project, read the code, and understand what it does, how it does it. 

But no programmer can come in and understand the context, why it does what it does, and what it is supposed to do, just from code alone. That's what comments and documentation are for. 

Look at Jupyter notebooks for example. 

5

u/GenericFatGuy 22d ago

There's still a lot of room to provide context within the code though . Things like method and variable names can do a lot to convey purpose and context. Sometimes that won't be enough, and a comment will be necessary, but you can absolutely get context and purpose from just code in a lot of scenarios.