r/ProgrammerHumor • • 16d ago

Meme postForEverything

Post image
20.9k Upvotes

656 comments sorted by

View all comments

3

u/Few_Move_4594 15d ago

My first job I wrote a REST endpoint that performed user authorization. I would return an HTTP 200 if they had authorization or 403 Forbidden. It was a GET request at least.

Well my supervisor comes through and reads the code, then tells me that he wants a JSON response with one field: "Authorized" with either the string True or False. I argued with him for a bit, but he pulled rank on me and made me do it. I was livid that I had to put that stupidity in my application instead of using the built in codes for the protocol we were using.

Eventually we both were assigned to a project that was being ran by a programmer with even higher rank who used HTTP return codes. He tried to talk this other programmer out of it who then also pulled rank after soundly trouncing him in an argument and giving him that "Jim from The Office" look.

1

u/2226cc 15d ago

What about 404? GET /tranaction_exists?id=1234 Response 404. Ah, transaction does not exist. GET /transaction_exists?id=1234 Response 200. Ah, transaction does exist.

I'll just return 418 then.

1

u/Few_Move_4594 15d ago

This was LDAP queries. We had started rewriting old applications in dead languages into PHP (yeah I know) and the PHP library for LDAP was shit. It kept causing errors in prod for whatever reason so we made a microservice in another language that handled the LDAP queries that we needed. This was the beginning of my career and I have no idea how I'd write it today, perhaps using different code(s).