Comment

Comment by alganet

This is nice. It reminds of how miserable my life is.

— Which HTTP code I should return for my API? I already used 404, 403, but I need another one. Damn, HTTP is so old and it makes no sense.

— You can't use HTTP codes like that Bob, they're not a free choice. They're for the protocol, not for your app.

— Let's look at the list. Hm... "412 Precondition Failed". Hey, it sounds nice. It fits to my use case. I'm gonna document it. It means the account is out of balance.

— What is this garbage? Please read the spec. This is going to make our API gateways, CDNs, everything go crazy. Can't let you move on with this PR.

— Look. I documented it, made an enum with the code, it's clean. I'm an experienced REST developer.

— It... it doesn't work like that Bob. Please, read the spec.

— Hey, got enough approvals, "412 Account Out Of Balance" it is! It passes the tests.

For each dev that knows proper HTTP, there's 10.000 Bobs.

parent alganet 2 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton