this post was submitted on 08 Sep 2024
157 points (97.0% liked)

Programmer Humor

32042 readers
973 users here now

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

founded 5 years ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 19 points 1 week ago* (last edited 1 week ago) (8 children)

Am I the only one who likes to write comments when I find code that took me a while to understand even when I didn't write the code? It helps me when I go back to that place and it helps other devs that have to do the same figuring things out as me. Idk if I'm just weird but I really like writing documentations and commenting my code

[–] [email protected] 8 points 1 week ago (1 children)

You're definitely not the only one.

In my opinion the important information we should record in comments is WHY, because the code can only explain HOW, maybe WHEN, but never WHY. If we don't know WHY, any refactoring done in the future could break the logic by ignoring assumptions made by the authors.

[–] [email protected] 2 points 1 week ago

// because I said so.

load more comments (6 replies)