this post was submitted on 27 Nov 2023
0 points (NaN% liked)

Programmer Humor

18971 readers
840 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
 
top 4 comments
sorted by: hot top controversial new old
[–] SpeakinTelnet@programming.dev 0 points 9 months ago (1 children)

I don't care how much you think your code is readable, plain text comments are readable by everyone no matter the proficiency in the programming language used. That alone can make a huge difference when you're just trying to understand how someone handled a situation.

[–] Fal@yiffit.net -1 points 8 months ago

There's nothing keeping the comments up to date with the code. Comments should be sparse and only on sections that aren't obvious why they're being done

[–] Prunebutt@feddit.de 0 points 9 months ago

Comments are lies that will happen sometime in the future

Comments are always overlooked if gode gets refactored. Language servers can't/won't parse them and they're easy to overlook.

If you name your functions/variables clearly, put complex logic into clearly named functions and keep the same level of abstraction in every function (which never exceeds roughly 50 lines), you hardly need any comments, if any.

Comments are for behavior that's not possible to convey clearly through code.

[–] pao@feddit.de 0 points 8 months ago

10 months? More like a weekend for me.