this post was submitted on 21 Mar 2025
633 points (99.5% liked)

Programmer Humor

21777 readers
1906 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
 

Original post: hachyderm.io (Mastodon)

top 50 comments
sorted by: hot top controversial new old
[–] Tja@programming.dev 12 points 1 day ago (1 children)

And you all complained when in C we used 1 and 0...

[–] npcknapsack@lemmy.ca 5 points 23 hours ago (1 children)
[–] Tja@programming.dev 4 points 20 hours ago (1 children)

Akcshually we use 0 and "not equal 0", since "not 0" would be 0xFF..FF, and (at least gcc) gives back a 1 for a true expression. No idea about the spec, probably undefined...

[–] npcknapsack@lemmy.ca 2 points 10 hours ago

Damn you for correcting me correctly! :D

[–] cupcakezealot@lemmy.blahaj.zone 5 points 23 hours ago

var true = false;

var false = true;

[–] pHr34kY@lemmy.world 5 points 1 day ago

The backend and frontend on the product I work on are like this.

As long as you remember that booleans are not strings and should always be parsed if they are, this won't be a problem.

I am yet to see a boolean.parse() implementation in the wild that is case sensitive.

[–] 30p87@feddit.org 176 points 1 day ago* (last edited 1 day ago) (2 children)

So we need to be careful with upper- and lowercase. Meanwhile the docs: > settiings

They specifically said "this is not a typo"!!!

[–] janonymous@lemmy.world 99 points 1 day ago (2 children)

Yes, the settiings are different than the settings. You also need to be careful with those.

[–] Bezier@suppo.fi 29 points 1 day ago

had to use a different spelliings at backend and frontend, otherwise it wouldn't work.

[–] LovableSidekick@lemmy.world 9 points 1 day ago* (last edited 1 day ago) (3 children)

no, settings = settings but settings != Settings, as we all know.

load more comments (3 replies)
[–] SatyrSack@feddit.org 80 points 1 day ago (8 children)

Could be worse. At least it's documented

load more comments (8 replies)
[–] dpflug@kbin.earth 15 points 1 day ago (1 children)

Implying Hell is frontend.... yeah, actually, that tracks.

[–] Robust_Mirror@aussie.zone 3 points 1 day ago

Baseball, huh?

[–] fibojoly@sh.itjust.works 19 points 1 day ago (1 children)

Glorious. I remember some hilarious nonsense in an API where the devs I worked with hadn't known they could just use boolean in JSON and had badly implemented it through strings, but this... This is amazing!

[–] jimmux@programming.dev 7 points 1 day ago

At my last job we had a lot of old code, and our supposedly smartest framework people couldn't be bothered learning front end properly. So there was a mix of methods for passing values to the front end, but nobody seemed to think of just passing JSON and parsing it into a single source of truth. There was so much digging for data in hidden columns of nested HTML tables, and you never knew if booleans would be "true", "TRUE", "1", or "Y" strings.

Never mind having to unformat currency strings to check the value then format them back to strings after updating values.

I fixed this stuff when I could, but it was half baked into the custom framework.

[–] jjjalljs@ttrpg.network 87 points 1 day ago (5 children)

Is the backend Python and the frontend JavaScript? Because then that would happen and just be normal, because Boolean true is True in python.

[–] testfactor@lemmy.world 129 points 1 day ago (5 children)

Probably, but if you're interpreting user inputs as raw code, you've got much much worse problems going on, lol.

[–] LostXOR@fedia.io 33 points 1 day ago (1 children)

[...]&register=import os; os.system("sudo rm -rf /"); return True

[–] MajorHavoc@programming.dev 15 points 1 day ago

Hey, that's my username too. Or it was going to be, while the site was still up.

What a coincidence!

I guess I'll wait for the site to come back, and see if it's still available...

[–] mmddmm@lemm.ee 17 points 1 day ago (3 children)

It's the settiings file... It's probably supposed to only be written by the system admin.

load more comments (3 replies)
load more comments (3 replies)
[–] shortrounddev@lemmy.world 20 points 1 day ago (3 children)

I curse the sadist who decided True should be uppercase in Python

load more comments (3 replies)
[–] Aatube@kbin.melroy.org 16 points 1 day ago (5 children)

Can't they just convert a "true" input to backend to uppercase

Yep they should use a config file format like JSON or TOML or YAML or what have you, and then decode that into python objects. Using an actual programming language for config is dumb as hell IMO. (inb4 pissed off suckless fans)

load more comments (4 replies)
load more comments (2 replies)
[–] Aurenkin@sh.itjust.works 33 points 1 day ago (2 children)

The cherry on top is that they didn't even spell settings correctly.

[–] SpaceNoodle@lemmy.world 25 points 1 day ago

settiings is spelled differently on the backend

[–] themaninblack@lemmy.world 4 points 1 day ago

I swear, spelling mistakes are such an indicator for a codebase and the overall quality of the software team, and maybe the whole company. No attention paid to detail leaks out into other areas.

[–] oldfart@lemm.ee 14 points 1 day ago (2 children)

What happened to the good old 1

[–] LeFrog@discuss.tchncs.de 21 points 1 day ago

Backend: 1

Frontend: ¹

[–] anton@lemmy.blahaj.zone 1 points 1 day ago
[–] ramble81@lemm.ee 9 points 1 day ago (2 children)

I’ve always hated case sensitivity. I know that at an ASCII level “variable” != “Variable” but is there really a reason to have a distinction between them?

[–] fibojoly@sh.itjust.works 17 points 1 day ago

You are thinking it's easy because you only think of e == E, but I'll let you look up collation and accents and, you know, Unicode and let you think about it.

There is nothing trivial about case sensitivity, except in trivial cases.

[–] vithigar@lemmy.ca 21 points 1 day ago (1 children)

You stated the reason yourself. Those are different values and matching in a case-insensitive manner is more work under the hood.

[–] ramble81@lemm.ee 5 points 1 day ago (3 children)

We do plenty of stuff for human consumption. Computers work for us, not the other way around. Insensitivity should be the default. It’s okay to give options. I’m not saying take that away.

[–] lengau@midwest.social 4 points 1 day ago* (last edited 1 day ago)

✋ Case insensitive filesystem
👉 Case insensitive file sorting

[–] WordBox@lemmy.world 5 points 1 day ago

Humans have to make it do the work. And that's how Mr; DROP TABLE makes his money.

load more comments (1 replies)
[–] BeigeAgenda@lemmy.ca 14 points 1 day ago (2 children)

Hear me out, what about using JSON to store the configuration in the Python backend?

load more comments (2 replies)
[–] LovableSidekick@lemmy.world 8 points 1 day ago* (last edited 1 day ago) (3 children)
load more comments (3 replies)
[–] Draegur@lemm.ee 7 points 1 day ago

Cap in the back, low-key up front. Got it.

[–] lily33@lemm.ee 10 points 1 day ago

That makes me think, perhaps, you might be able to set it to exec("stuff") or True...

load more comments
view more: next ›