this post was submitted on 04 Nov 2024
110 points (96.6% liked)

Programmer Humor

32558 readers
477 users here now

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

Rules:

founded 5 years ago
MODERATORS
 
all 27 comments
sorted by: hot top controversial new old
[–] GiorgioBoymoder@hexbear.net 38 points 2 weeks ago* (last edited 2 weeks ago) (2 children)

it's really fucking with me that neither axis follows a progressive ordering so I'm going to post a fixed (debugged) version. EDIT: lmao this is the most fucked up, inconsistent alignment chart I've seen. here it is fixed:

everything -> sometimes -> nothing

know -> not sure -> don't know

[–] TheDoctor@hexbear.net 8 points 2 weeks ago
[–] yogthos@lemmy.ml 6 points 2 weeks ago

haha nice work, that is an improvement :)

[–] 7eter@feddit.org 15 points 2 weeks ago

There might be a bug in the labeling code here

[–] gregor@gregtech.eu 13 points 2 weeks ago (2 children)

You doubled the "everything works, and I don't know why"

[–] magic_lobster_party@fedia.io 6 points 2 weeks ago (1 children)
[–] gregor@gregtech.eu 2 points 2 weeks ago

I, in fact, don't

[–] yogthos@lemmy.ml -2 points 2 weeks ago (1 children)

one's not sure why and the other is don't know

[–] Imnebuddy@lemmy.ml 7 points 2 weeks ago* (last edited 2 weeks ago) (1 children)

The center one is the same as the top right. I think the center is supposed to say "nothing works, I'm not sure why" to match the pattern with the rest.

[–] yogthos@lemmy.ml 3 points 2 weeks ago

oh haha oops

[–] autoexec@lemmy.blahaj.zone 13 points 2 weeks ago (1 children)

Where does "it used to work, but now it doesn't, and I don't understand how it could ever have worked" fit in?

[–] yogthos@lemmy.ml 4 points 2 weeks ago

haha can't believe I forgot that gem

[–] TheDoctor@hexbear.net 10 points 2 weeks ago (2 children)

I helped a friend debug a script last week that was working inconsistently in really weird ways. I looked at the script and it was all event hooks littered with sleep calls. I told him he was basically fuzz testing his own script and then getting surprised when he found race conditions. Shit was wild. Also, sometimes getters in Python are a mistake.

[–] yogthos@lemmy.ml 7 points 2 weeks ago (1 children)

I find setters/getters are generally an antipattern because they obfuscate behavior. When you access a field you know what it looks like, but if you pass it through some implicit transformation in a getter then you have to know what that was.

[–] TheDoctor@hexbear.net 5 points 2 weeks ago (1 children)

Yeah. I can understand the use case when it’s something relating to keeping simple state in sync by replacing it with derived state. But this particular case was flushing a cache after each get, which made each get of the property non-deterministic based on the class’s state.

[–] yogthos@lemmy.ml 6 points 2 weeks ago

lol yeah that sounds like a nightmare

[–] jollyrogue@lemmy.ml 4 points 2 weeks ago (1 children)

Aren’t setters and getters discouraged in Python?

I remember reading something like, “This isn’t C++ , and Python doesn’t have private vars. Just set the var directly.”

[–] TheDoctor@hexbear.net 2 points 2 weeks ago

In the way that’s common in languages like Java where you’re making a property read-only, yes. But there’s a whole protocol in Python called descriptors where you can override the . on a field. The most common form of these is class methods annotated with the @property annotation, which makes it so the method can be accessed as if it were a property.

[–] BlueMagaChud@hexbear.net 7 points 2 weeks ago (1 children)

the "sometimes works, don't know why" is the most maddening, I love tearing my hair out just trying to get it to fail reliabily so I've got a single hint

[–] yogthos@lemmy.ml 8 points 2 weeks ago

Any problem that's not repeatable is incredibly frustrating, and you're rarely sure if you've truly fixed it in the end.

[–] Bezier@suppo.fi 5 points 2 weeks ago

Brain clot inducing labeling job here

[–] headerfile@lemmy.blahaj.zone 4 points 2 weeks ago (1 children)

i have so may questions; why are the top right and dead center duplicates? why do they have different images? why are the phrases inconsistent? why are the images and phrases distributed at random? how did you miss this?

[–] yogthos@lemmy.ml 1 points 2 weeks ago (2 children)

the best thing about memes is that anybody can take it and remix it to make it better :)

[–] Blessthisiummunity@lemmy.zip 3 points 2 weeks ago

One thing, I don't know why