this post was submitted on 24 Oct 2023
711 points (97.6% liked)

Programmer Humor

19572 readers
1682 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 1 year ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 54 points 1 year ago* (last edited 1 year ago) (16 children)

me when first starting out at a job commenting everything I can
VS
me a couple years in completely lost because I never updated the comments and now none of them make any sense whatsoever

[–] [email protected] 60 points 1 year ago (14 children)

Commenting well is a highly advanced skill. I generally prefer no comments on code since it's less likely to confuse people and I'll merrily purge auto-doc comments and anything like

// getId() returns an id

That comment has negative value.

[–] [email protected] 9 points 1 year ago (4 children)

Comments should only be used to describe stuff that’s otherwise difficult to convey with code.

[–] [email protected] 3 points 1 year ago (1 children)

Yeah. Most of the time I use comments in my algorithms, as they often use some weird optimized black magic which are difficult to understand without comments.

[–] [email protected] 1 points 1 year ago

Like don't set this value to the obvious default. Bad stuff happens

load more comments (2 replies)
load more comments (11 replies)
load more comments (12 replies)