1125
you are viewing a single comment's thread
view the rest of the comments
[-] ipkpjersi@lemmy.ml 13 points 1 month ago

I kind of get the idea that code should be self-documenting, but at the same time, there's so many crazy business rules that comments are basically a necessity if nothing else other than to explain why in the hell the crazed mess that provides the required functionality for the business rules exists.

[-] jjjalljs@ttrpg.network 12 points 1 month ago

Yeah some comments are not useful

# returns the value as a string
return str(user.id)

Some comments are

# returns the user id as a string because ZenDesk's API throws errors if it gets a number.
# See ticket RA-1037
# See ZenDesk docs: https://etc/
return str(user.id)
[-] PonderingPotato@discuss.tchncs.de 6 points 1 month ago

That's typically what people who advocate for less/no comments really mean. The code should self explain "what" it does, but if the "why" isn't obvious (i.e. confusing business logic) nobody argues that you shouldn't comment it. That's how I've worked in every company I've been at (and all developers around me) from 50 person start ups to >2k people. It's really common mentality with Ruby developers

[-] JcbAzPx@lemmy.world 2 points 1 month ago

Anyone complaining about commenting should be forced to code in assembly for a while.

[-] ArsonButCute@lemmy.dbzer0.com 1 points 1 month ago

I've literally added comments that say

this is hacky bullshit but don't touch it

this post was submitted on 13 Nov 2025
1125 points (99.1% liked)

Programmer Humor

28191 readers
724 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 2 years ago
MODERATORS