this post was submitted on 14 Sep 2025
690 points (99.4% liked)

Programmer Humor

26332 readers
2249 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
 
top 50 comments
sorted by: hot top controversial new old
[–] ipkpjersi@lemmy.ml 4 points 7 hours ago

Oh no... this brings back memories LOL

[–] whoisearth@lemmy.ca 12 points 11 hours ago

Fun story close to a decade ago we were attempting to upgrade our batch scheduler called Tidal to version 6x which had a RESTful API.

One of the reasons we dropped the product was because we were getting 200 status codes meanwhile the output was a java dump of an error message.

They were adamant that this was an us problem, no matter how much I tried to explain to them with numerous links explaining to them that if something has a 200 status code that should mean things worked.

They argued that the 200 meant we were hitting the API fine. We would have to write code to read the return for if it was a error or not. I still don't think they understood how stupid they were, even all these years later.

[–] TomasEkeli@programming.dev 35 points 23 hours ago (4 children)

Please, please, please, PLEASE return error-codes and problem-details.

Here's the RFC: https://www.rfc-editor.org/rfc/rfc9457.html

[–] douglasg14b@lemmy.world 1 points 5 hours ago (1 children)

Counter argument is that error codes and problem details can be used by attackers to reverse engineer and find exploitable parts of a system.

Within reason anyways

[–] Feathercrown@lemmy.world 1 points 5 hours ago

So can a 200 response with an error description

[–] ryannathans@aussie.zone 3 points 11 hours ago (1 children)

It's often valid to serve a 200 OK with an error in the application data.

[–] darvit@lemmy.darvit.nl 2 points 12 hours ago

This looks so over-engineered. Most of the time you only need an error message. Make the message clear enough so that it can be shown to the end user.

[–] neuracnu@lemmy.blahaj.zone 167 points 1 day ago
[–] NigelFrobisher@aussie.zone 24 points 1 day ago* (last edited 1 day ago) (1 children)

Yep, I’ve got one of these at work now. Technically, 200 can make sense here if you’re using HTTP as RPC transport, as the server relayed the request to its handler and returned the outcome, but damn if it’s not annoying to actually process the response.

I’ve also seen a lot of devs tie themselves into knots trying to map various execution types to the “semantically correct” HTTP code, but the thing is the abstraction of HTTP is not based around RPC and it’s ultimately a pretty weird fit that we’ve somehow come to view as normal.

[–] TomasEkeli@programming.dev 28 points 23 hours ago (1 children)

Then just return a 500 - Server error. Nice and obscure.

The ability to separate "something wrong with what you sent" (4XX) and "something wrong on the server" (5XX) is very valuable in itself.

[–] MyNameIsIgglePiggle@sh.itjust.works 36 points 21 hours ago* (last edited 21 hours ago) (3 children)

Yep

  • 2xx - it's good
  • 3xx - not here cunt
  • 4xx - you don fucked up
  • 5xx - we fucked up, whatever you do aint changing shit.
[–] Ziglin@lemmy.world 2 points 58 minutes ago

The number of times I've gotten 5xx codes for bad requests is annoyingly high.

[–] mercano@lemmy.world 11 points 17 hours ago* (last edited 17 hours ago)

1xx - We’re still working on it

[–] Hawk@lemmy.dbzer0.com 5 points 16 hours ago

And then there's 418

[–] umbraroze@slrpnk.net 33 points 1 day ago

Aaagh! Getting some random old person flashbacks.

Kids. I r-remember a day... You won't believe this... I got a 404 error page... It was otherwise a normal 404 page with a normal message on it, but it had a giant ad on it... like "while you're here, how about you buy this stuff"... It was hell... You've got no idea how lucky you kids are with uBlock...

[–] napkin2020@sh.itjust.works 90 points 1 day ago* (last edited 1 day ago) (3 children)
[–] spizzat2@lemmy.zip 40 points 1 day ago* (last edited 1 day ago) (1 children)
[–] meekah@gehirneimer.de 16 points 1 day ago

wouldn't that be more like

new Promise(() =>{
    return { "ok": false };
})
 { "OK": "Ah ah ah, you didn't say the magic word." }
[–] cupcakezealot@piefed.blahaj.zone 60 points 1 day ago (2 children)

error = true with no description or answer is basically ten years of searching stackoverflow and reddit threads for an answer.

[–] douglasg14b@lemmy.world 3 points 5 hours ago

Honestly at this point if it's source available it's almost faster to dig through and find the affected module on source to determine behavior.

Unless of course it's just crazy abstracted, which can be an unintentional form of obfuscation when applied poorly.

[–] wetbeardhairs@lemmy.dbzer0.com 6 points 19 hours ago (1 children)

Or a link to a thread on microsoft answers that 404s

that's the worst due to how microsoft answers redirects work making it impossible to go back to the previous page.

[–] WhiteRice@lemmy.ml 22 points 1 day ago (1 children)

It’s not us, it’s you

[–] lunarul@lemmy.world 22 points 1 day ago* (last edited 1 day ago)

It's us: 5xx

It's you: 4xx

[–] Slotos@feddit.nl 18 points 1 day ago (12 children)

JSON API almost always means “not REST”. In other words, it works as intended.

[–] JackbyDev@programming.dev 5 points 20 hours ago

I don't wanna be pedantic but most things we call REST aren't REST. The original definition of REST is what we typically call HATEOAS. So when you say JAON API almost always means not REST you need to qualify that.

load more comments (11 replies)
[–] Olap@lemmy.world 7 points 1 day ago (7 children)

GraphQL makes this same mistake

load more comments (7 replies)
[–] Cruel@programming.dev 14 points 1 day ago (1 children)

Congratulations! You failed.

load more comments (1 replies)
load more comments
view more: next ›