this post was submitted on 26 Nov 2023
698 points (89.1% liked)

Programmer Humor

19145 readers
1480 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
[–] wit@lemmy.world 9 points 9 months ago (3 children)

Code should be self documenting.

[–] JohnDClay@sh.itjust.works 19 points 9 months ago (1 children)

But you should also comment it, things obvious to you aren't obvious to even future you.

[–] gornius@lemmy.world 8 points 9 months ago

General rule of thumb: Comments say why is it here, not what it does. Code itself should describe what it does.

[–] Sylvartas@lemmy.world 10 points 9 months ago

But then you write code in the real world and find out that you have to write some ass backwards code every other day because of deadlines, backwards compatibility or whatever, and suddenly you realize that despite your best efforts, code cannot always be self documenting.

Source: me.

[–] executivechimp@discuss.tchncs.de 1 points 9 months ago (1 children)
[–] Sylvartas@lemmy.world 1 points 9 months ago* (last edited 9 months ago)

In a vacuum, sure. On a real project of substantial size with more than one programmer, I'm afraid it quickly becomes a "cannot"