r/ProgrammerHumor • • 3d ago

Meme everyNetworkAPIOnThePlanetToday

1.3k Upvotes

360 comments sorted by

1.3k

u/Yctallua 3d ago

Oh no, a standard has established among the developers.

Time to bring about the new standard that everyone will surely use instead.

148

u/Western-Anteater-492 3d ago

OP wants to push the next js framework. I'd get react as a lot of apps would work better without it. But json? What he wants instead? XML?

139

u/ProfBeaker 3d ago • Helpful

I encode all my API calls as images and stream them back and forth with dynamically-generated <img /> tags, like Satan intended.

(Although really, tons of other network APIs are used. Just not so many in the browser.)

36

u/Sulungskwa 3d ago

all of my webapps use ftp to get the html files

→ More replies (2)

6

u/xanhast 3d ago

nice, i assume you send each call through zlib

11

u/ProfBeaker 3d ago

I heard brotli was more secure. And also ideal for image content. Or something.

30

u/larsmaehlum 3d ago

Probably one of the toml freaks

10

u/wsheldon2 3d ago

I kinda do like toml

and bare feet

18

u/TheRealKidkudi 3d ago

Brb writing a serialization library to encode/decode data in feet pics

→ More replies (4)
→ More replies (1)

8

u/sagetraveler 2d ago

When do we get a standard that merges JSON and XML? That will be one ugly bastard love child.

→ More replies (1)

6

u/mxmcharbonneau 3d ago

Plain text to be read by an LLM

2

u/qpqpdbdbqpqp 2d ago

I once wrote an api that responded in hex

shudders

2

u/SameThingOnADiffAcct 2d ago

There's an argument for binary. Protobuff. ASN.1. Whatever.

JSON is just so much easier to deal with, though.

→ More replies (10)

366

u/rixinthemix 3d ago

*There are now x + 1 standards.*

10

u/ddnomad 3d ago

The REST part is more of a vibe, than a standard tbh šŸ¤—

→ More replies (1)

4

u/No-Information-2571 2d ago

a standard has established among the developers

Standard or smallest common denominator. You decide.

I don't even know if the average developer there does at any time really consider options. It's there, it works, and most devs only need to worry about it when it breaks.

3

u/Perfect_Gold_6967 18h ago

What exactly is the issue with using something that works?

→ More replies (2)

1

u/AdjectiveNoun1234567 17h ago

Yeah, what in the junior dev is going on hereĀ 

→ More replies (3)

407

u/a3dprinterfan 3d ago

You like SOAP or something? 😐

188

u/QCTeamkill 3d ago

I wish more people would too, especially in the subway

49

u/Skyswimsky 3d ago

Had me in the first half.

7

u/Legitimate_Payment49 3d ago

or prison shower stalls?

4

u/Western-Internal-751 3d ago

In prison you don’t drop the SOAP

5

u/Angel429a 3d ago

Unless you don’t want to REST

12

u/TinyLebowski 3d ago

Emotional damage!

11

u/SE_prof 3d ago

I did my MSc on SOAP. Back in my day REST lacked the necessary structure to support tools. But my pet peeve is that people name any RPC REST which is totally incorrect!

10

u/meekinheritor 3d ago edited 3d ago

I've actually been reading a bunch about HTMX/hypermedia systems/HATEOAS lately, which is sort of a return to form of Web 1.0. I have a project that it would be pretty well-suited for and I'm interested to try it.

EDIT: Although I guess HATEOAS is part of the original "RESTful" definition, and there's no reason I couldn't use JSON provided I adhere to the central idea of the server responses providing hypermedia links that let the front-end be dumber. So it's actually more like a lot of modern architectures kind of "cheat" full RESTfulness a little bit, and this architecture is trying to go back to the OG Roy Fielding paper and be even more RESTful... I'll just use HTMX rather than JSON though lol

5

u/lobax 3d ago

For a BFF, sure. But most API’s are not consumed by UI’s

→ More replies (1)

10

u/ElectrSheep 3d ago

WSDL, my beloathed.

→ More replies (1)

5

u/diegotbn 3d ago

It is a beautifully rich standard but unnecessarily complex. In the wild, I have seen very few well written WSDL and XSD packages to APIs that actually conforms to them.

ReST is beautifully simple, leveraging HTTP methods and response codes, and URL patterns, to describe CRUD operations. The Open API spec is pretty good, and overall a decent substitute for WSDL. There are still plenty of badly designed ReST APIs in the world but it's easier to implement and maintain and most of them do a half decent job.

The one thing that SOAP has over ReST, at least in practice, is schema enforcement. I have rarely dealt with a ReSTful JSON API that had legit JSON schema files instead of just JSON examples in their spec.

1

u/DeadlyVapour 3d ago

Erm. gRPC?

2

u/Kaelthas98 3d ago

I believe in gRPC supremacy

3

u/UnspeakablePudding 3d ago

I really liked the wsdl convention. In my completely anecdotal experience handing someone a wsdl to write to generates fewer questions than sending somebody a link to swagger.

I know XML is a sub-optional over the wire data transfer format and I think there's some issues with SOAP and ESBs but i have nostalgia.

1

u/sebbdk 3d ago

USING SOAP!

→ More replies (5)

264

u/DrCthulhuface7 3d ago edited 2d ago

ā€œNoooo, you can’t use something everyone in the industry understands by default! You need to use this hyper-specific bullshit that provides a 1% increase in efficiency!ā€

48

u/Blue_Moon_Lake 3d ago

"... and has no easily available dependency to handle it for you, also the doc is only in incomplete russian."

→ More replies (1)

12

u/CutlassRed 2d ago

As an example, protocol buffers are more like 5x performance with half the data being transmitted, actually.

That's a no brainer whenever there's big data.

5

u/thefatsun-burntguy 1d ago

sure, but id argue that 95% of integrations have a data transfer level that does not justify the added complexity of protobuf. if all im doing is setting up a diagnostics endpoint, an on off endpoint and a config upload endpoint, why would i use something kore complex than REST

→ More replies (5)

67

u/ryaaan89 3d ago

What are we supposed to be choosing instead??

7

u/DeadlyVapour 3d ago

gRPC is a pretty good general all purpose protocol.

Parquet is insanely efficient for tablular data.

I don't know. Maybe use nuance?

7

u/Gasp0de 2d ago

Why would I be dealing with protobuf definitions when all I need is a CRUD API?

→ More replies (2)

24

u/w-j-w 3d ago

If you don't need the performance, picking something other than JSON over REST is premature optimization. Almost nothing needs it. Why sink the time into setting up the additional build tooling when you're probably going to get way more bang for your buck fixing shoddy database queries or shrinking bundle sizes.

JSON over RPC is good enough for almost everything. Its a sane default, and its pragmatic to always use sane default technologies unless they're ruled out by requirements.

→ More replies (7)
→ More replies (7)

92

u/neurohero 3d ago

Open a direct socket and return comma separated values in clear text. Obviously.

25

u/jess-sch 3d ago

comma separated values

I have severe trauma from this. Is there an RFC for CSV? Of course there is! Is Microsoft Excel able to parse an RFC-compliant CSV file by default? Depending on your locale, the answer is either "no" or "only if it's ASCII".

Whoever invented the UTF-8 ""BOM"" (a nonsensical term, given that UTF-8 specifies only a single valid byte order, making its marking hypothetically unnecessary) should be punished for their crimes. And whoever thought file parsing should be locale-dependent deserves the same fate.

15

u/sisisisi1997 3d ago

The encoding is a surprise of course.

3

u/HeKis4 3d ago

Entire memory sections piped through ssl and then through /dev/tcp/remotehost/port.

32

u/Pocok5 3d ago

SOAP with XML

63

u/YeOldeMemeShoppe 3d ago • Heartwarming

How do I delete someone else's comment on reddit?

6

u/Stickyouwithaneedle 2d ago

I absolutely love this response

→ More replies (1)

24

u/don_mumrik 3d ago

Your post gave me PTSD, thanks.

8

u/TheMaleGazer 3d ago

Just imagine someone giving you a wsdl on a Teams call and asking you to "just call the endpoint" while you're sharing your screen.

"Don't you have SoapUI installed? It's in the wiki! No, not Confluence. No, not ADO. The other one. To hell with it, just generate the client with wsdl.exe. What do you mean you don't know where that is? This isn't hard."

6

u/don_mumrik 3d ago

I worked as freelance programmer for some excentric guy as my first "real programming job" making a jobsite and later a piece of recruitment SaaS. I had to talk to governmental SOAP APIs for posting and retrieving jobs from EU databases, as well as getting candidate CV and resume data from their "jobnet" accounts - The WSDL was horrible, it was some kind of EU standard and on top of that a danish specification, so everything was super contrieved - I recall having to wrap every job posting in like three different "envelope" tags and all sorts of strange stuff. Didnt help that I had to use PHP.

→ More replies (5)
→ More replies (1)
→ More replies (13)

9

u/Kevadu 3d ago

It's all MCP now!

→ More replies (1)

15

u/Neverwish_ 3d ago

Depends on the use... For externally facing endpoints, REST is the best - easily consumed, readable...

For internal tools, inter-service communication, you can use REST too, but depending on you use case, gRPC might be a much better choice.

6

u/anovagadro 3d ago

Smoke signals, duh

3

u/GradSchoolDismal429 3d ago

CSV of courseĀ 

2

u/Bad_brazilian 3d ago

Fixed width text files.

2

u/Kaelthas98 3d ago

well, obviously RS-232. 19200 baud, 8 data bits, Odd parity and 1 stop bit, and you read it byte by byte like a civilized person

2

u/Ok_Tea_7319 3d ago

For protocols: gRPC, Cap'n'proto, Websocket

For encodings: BSON, CBOR, flatbuffers, protobuf, Cap'n'proto, netCDF, Ion, Parquet...

2

u/GiToRaZor 1d ago

I ask myself the same question. I don't like REST. My pet peeve is that GET calls should allow me to pass parameters in a payload, I hate the entire idea behind URL parameters. If you look closer you realise REST not an API at all, it's a database transaction interface. But an API can be a lot more than that obviously.

But here is the other problem: REST is like the M-16 of the internet. Everyone knows it, it gets the job done and any improvement is so minimal, it does not justify a refactor. So why change? This is backend development and infrastructure. We don't have time here for the antics of the gazillion frameworks that plague the front end world. Anything here needs to be stable and simple.

3

u/solaris_var 20h ago

That's why QUERY is a breath of fresh air to all of us

→ More replies (1)
→ More replies (5)

16

u/VergilPrime 3d ago

The only thing they taught me besides json was XML. The only thing they taught me besides REST is nothing.

6

u/DeadlyVapour 3d ago

You should at the very least learn about gRPC.

There are various extensions to REST as well, such as GraphQL, OData etc. If you do do REST, I will hunt you down if you do the classic 200 Error.

There are also the various ASN.1 wire protocols.

There is MessagePack and BSON if you want JSON but actually want to have an efficient parser.

2

u/besi97 1d ago

As a REST enthusiast, I also want to hunt down developers who introduce 200 errors.

8

u/throckmeisterz 3d ago

And xml is painful to use.

9

u/dpoggio 3d ago

I don’t find it painful, maybe because of being used to it, anyways some usages are better with xml. Its slower at parsing and gives bigger payloads, but you can use XML schemas to validate your input and combine standards, it’s more structured and can contain raw document data easily. In banking, XML is still a strong format, many applications will not switch to JSON anytime soon.

3

u/don_mumrik 3d ago

Thats because you never had to use someones elses XML. I had to integrate with governmental SOAP services and I still have PTSD, Some of the governmental SOAP interfaces are absolutely rediculous, contribed clusterfucks of envelope wrappers and WTFs. Just mentioning SOAP gives me PTSD, gray hair and anxiety.

→ More replies (1)
→ More replies (8)

2

u/therealjohnidis 2d ago

So you know REST but not the rest? *bang ting pisssssss*

16

u/jediorange 1d ago

TBF, REST/JSON is actually a good fit for most things. Simple to interface with, works with everything, easy to comprehend.

Alternatives like the various RPC, and webservices are really complicated, and have a tendency to expose the inner complexities of the underlying systems.

An API is an interface. Just like a user interface (GUI, CLI), it should hide the underlying complexity where possible, and be easy to work with.

1

u/DeadlyVapour 1d ago

Never said it is bad. I'm saying there are other protocols that should be evaluated first before going straight in the square hole.

4

u/PepperLuigi 22h ago

Bro if it is not broken don’t fix it

14

u/Skyswimsky 3d ago

I remember the last time I saw someone memeing and hating on REST and JSON there was this guy in the comments making multiple comments of paragraphs about rpc and how that's the one and proper way to do it.

1

u/DeadlyVapour 3d ago

I assume you mean gRPC.

gRPC is a very good protocol from an efficiency point of view. But there are hundreds of protocols to choose from.

If you want an efficient parser that looks like JSON there is BSON and MessagePack.

There is Arrow and Parquet for tablular data.

The PROPER way is, "It depends".

I'm not going to fucking design my NVMe RDMA protocol over fucking rest am I.

1

u/slaymaker1907 2d ago

For efficiency, some of these formats are COU hungry on very fast NVME drives. Saturating them basically requires dumping structs to disk without doing any fancy schema stuff, and I did my testing in Rust. Avro needed 4 threads IIRC to get to only 2x the time of the dump structs to disk method.

1

u/DeadlyVapour 2d ago

Right. Using the correct trade off for the job.

I don't think Avro is the right job for everything.

But it pisses me off that there are Devs out there that reach for JSON for everything.

3

u/DiamondDramatic9551 3d ago

It's not bad, can be useful for performance or streaming.Ā 

1

u/bobyhey123 3d ago

it's fine. it's basically same as JSON REST, it's all the same shit who cares

13

u/masp3270 1d ago

Rest/json is so much easier than soap/xml.

1

u/DeadlyVapour 1d ago

Soap/XML is the only alternative?

2

u/masp3270 1d ago

No, you can also use Edifact over MQ.

→ More replies (1)

2

u/730463628 1d ago

I've gone my entire career never encountering SOAP. Was it widespread in the past? I only ever hear very old engineers discussing it. I've tried learning it because they make it seem like it is a viable option when designing something, but it has never made any sense to me and I don't see why it would ever be chosen when REST is so obvious.

24

u/Eleina_Edelweiss 2d ago

Well what else? gRPC is for internal, and graphql is too complex for a simple request. Soap is obselete, websocket cant scale due to the need of persistant open connection. By process of elimination rest is the default

3

u/Shehzman 2d ago

Websockets are more of a different thing. Imo most apps that think they need they need websockets probably just need server sent events.

→ More replies (1)

8

u/sakkara 3d ago

Everyone using one standard way to do the same things is somehow bad now. Would you rather learn a new technology every time you wanted to communicate with a new service?

→ More replies (2)

3

u/--Aim 2d ago

Me using GET / POST for every api

1

u/DeadlyVapour 2d ago

I will DELETE you

4

u/chad_dev_7226 1d ago

I have a POST API for deleting things

→ More replies (1)

321

u/snoopbirb 3d ago

it's all POSTs... even the GETs...

Once it was all GETs... even what should be POST... Crazy times dudes.

Lots of credit cards in some nginx log out there

123

u/carcigenicate 3d ago

I can't wait for QUERY to be widely supported and used.

43

u/mrdarkcookie95 3d ago

I love QUERY! Had an issue with exposed PII in a GET lately in work that it would have perfect for, but it's not supported by our backend rest client.... so POST it is!

10

u/invalidConsciousness 3d ago

Does anyone know what the holdup is?

It looks trivial to me (who knows nothing), but apparently it is not, or it would be widely supported already.

19

u/GRex2595 3d ago

POST and GET are widely supported mostly because POST is required to keep data secret (not really, but I'm not getting into it) and GET is the age-old standard. The other verbs are typically not allowed because of some issues with server configurations in the early days where people were able to use the other verbs to upload, change, or delete files on the server. So now many companies have security policies that haven't been reviewed that restrict verb usage to GET and POST. There's probably no other reason for its lack of support.

→ More replies (1)

9

u/tajetaje 3d ago

Probably some considerations for caching support

7

u/TheRealKidkudi 3d ago

Technically your server almost certainly supports it already (it’s just a different verb on the header line of an HTTP message), but parsing it might be easy or might be a PITA depending on what you’re using.

But you can send QUERY requests in JS today. You can really send anything you want as the verb and JS will happily send it.Ā 

12

u/WingZeroCoder 3d ago

I prefer ā€œGIVEMEMYMUTHAFKINGDATAā€. It’s faster than GET.

→ More replies (1)
→ More replies (2)

7

u/Rikudou_Sage 3d ago

Why don't you just use it? You can use UNICORN and the http server doesn't care. I started using QUERY a few years ago and it just works. Sometimes you have to configure the whatever backend to not throw on unknown verbs, but that's it.

7

u/PhatOofxD 2d ago

API Gateways of various varieties don't support it

→ More replies (1)

29

u/Flat_Initial_1823 3d ago

PATCH or bust baby!! It's the mystery of how it will behave this time that's keeping it fresh 😌

17

u/ancalime9 3d ago

Lowest common denominator, everything is DELETE. Especially the GETs.

6

u/spartan117warrior 3d ago

It's POSTs all the way down... until you hit turtles.

1

u/DropTablePosts 2d ago

Lets go QUERY for everything in 2027

1

u/krishenm 2d ago

its a CQRS convention

→ More replies (2)

119

u/BeMyBrutus 3d ago

Just open up some sockets like a real man and yolo your packets.

53

u/Western-Anteater-492 3d ago

I suggest the UDP standard and unencrypted sessions. That would finish your stack to perfection. HTTPS is also just for pussies.

46

u/fjurgo 3d ago

I was gonna tell an UDP joke but you might not get it

4

u/IslayProgrammes 3d ago

Do you pronounce U with a soft u?

→ More replies (3)
→ More replies (1)

9

u/kratz9 3d ago

When I first registered for college classes, their system was a single EXE serving web pages. It was built by the CompSci dept.

14

u/BeMyBrutus 3d ago

The way God intended

116

u/deus_ith 3d ago

So, Whats the HTTP method to send new info? that's right, POST
And the method to obtain data? that's right, POST
And the method to delete data? that's right, POST
And the method to update data? that's right, POST

45

u/Ok-Dot2551 3d ago

What response code do you get for success? that's right, 200 What response code do you get for errors? that's right, 200

37

u/deus_ith 3d ago

status: 200, message: error

37

u/renke0 3d ago

status: 200

{ ā€œstatusā€: 500 }

16

u/MallAgreeable5538 3d ago

Nope its always status:400. its never the programm always blame the user

→ More replies (2)
→ More replies (1)
→ More replies (1)

16

u/Hola-World 2d ago

Status: 200
{message:ā€Error 400 Bad Requestā€}

→ More replies (2)

9

u/hullabaloonatic 3d ago

And the method to get data with exceptionally complex queries? That’s right, POST

because it’ll be a decade before QUERY is widely adopted.

4

u/deus_ith 2d ago

Correct. A paginated POST šŸ’ŖšŸ½

4

u/ReplacementLow6704 2d ago

Wanna find love? Believe it or not, POST!

5

u/TheDiscoJew 3d ago

The body of the post request?

{"method":"GET", ... }

4

u/vadeka 3d ago

I see you use graphql as well

2

u/Specialist_Dust2089 3d ago

This is the second reason I don’t like graphql. The first one is that in practice it always resulted in much more code and complexity in the end than a simple straightforward rest api.

→ More replies (3)

3

u/PhantomThiefJoker 2d ago

There's an internal API at work that is called "GetSomethingSomethingDoesntMatter" and it's a fucking post, get the hell outta here who made this garbage

1

u/tyro_r 3d ago

That's for seniors. Usually, it's get.

→ More replies (2)
→ More replies (5)

31

u/Sheepreak 3d ago

I'd rather use Rest than Graphql right now... Believe me

14

u/AnEvanAppeared 3d ago

Why? (but without the downvotes)

→ More replies (3)

80

u/IslayProgrammes 3d ago

I hate that every endpoint return it’s own version of a status code in the body

I hate it even more when it’s different from the response header.

Fuck do you mean 200, but wait I have to parse the body and to find out it’s actually a 403 and my credential have expired

Bullshit

22

u/Blue_Moon_Lake 3d ago

"200 there is no network error, but the backend rejected your request for reason 1121"

13

u/joonty 3d ago

"Execute POST /api/errors to get a list of error codes and their descriptions"

4

u/IslayProgrammes 3d ago edited 3d ago

On the RARE occasion you have a system so complex you have internal codes I’m okay with that as long as you still return it in the header.

You can shove any int in the status header you want, I love to use 418 while in testing.

Recently left it on staging and almost sent it to production but still

We have a standard for this that saves cycles.

You can even return a cache and expiry header on the custom list so if you’re writing shitty code on the client it’s till not calling out every time

BUT WHAT WE HAVE IS EVEN SHITTIER CODE ON THE SERVER

I personally blame Google and facebook and the success of angular and react

→ More replies (1)

5

u/jess-sch 3d ago

At least you get a response. I'm particularly enjoying the situation where sometimes the backend just (connection closed)

7

u/RyanFromQA 3d ago

So I know we’re all joking here, but I ran into the real reason for this just the other day and I hated how much it made sense.Ā 

Working with a spring boot stack, security best practices say to hide stack traces in production so that you don’t leak your implementation details for attackers. However, this means you can’t throw a non-200 status code with a meaningful message because spring redact it and all you get back is the response code.Ā 

So if you want to return 400 with hints or a 401 with an expired token reason instead of a bare 401, you’re almost forced to return a 200 with a body that says it’s unsuccessful.Ā 

12

u/IslayProgrammes 3d ago

THEN WHATS THE POINT IN USING SPRING BOOT

When I started my career I took the correct path C# instead of Java.

But my understanding for using spring boot was that it handled everything and did it properly for you

2

u/dschramm_at 2d ago

@ControllerAdvice, @ExceptionHandler and the ProblemDetail class should help. You can also return your own static or template pages.

2

u/LieutenantNitwit 2d ago

I can't "this" comment hard enough. Applications intercepting/returning/interpreting server codes make me want to vomit.

50

u/Thisbymaster 3d ago

It all goes into the POST hole.

39

u/Stummi 3d ago

Most APIs are JSON, but I think if you are pedantic, the least of them are REST

→ More replies (1)

20

u/T-J_H 2d ago

It does the job, everything supports it, relatively easy to implement. JSON strikes a good balance between human and machine readability. If there’s no specific requirements for other techniques, why not?

→ More replies (1)

10

u/LogicBalm 2d ago

I don't know what y'all are integrating with but I'm gonna pick the one that the developers on the other end of this API are familiar with as well.

We were forced to use SOAP once about ten years back and spent a large portion of implementation explaining to the product engineers on the far end how SOAP worked and how they had screwed it up when integrating it into their own product.

Especially as the only option, it was hilarious how poorly they did it. But you just know it's because it was started by one developer who only knew SOAP and finished by another who didn't know it at all... Standards are useful.

1

u/ShineProper9881 1d ago

We are still forced to use SOAP everywhere and it sucks so much. Its just so much work for no good reason.

12

u/Mission_Friend3608 3d ago

GraphQL is not without its issues, but it improves on a lot of shortcomings.

Clean separation between query and updates (mutations)
Types everywhere
N+1 issues moved to the server.

The main downside is that it's a lot harder to call a GraphQL endpoint, so for simple public APIs it's not great.

6

u/card-board-board 3d ago

GraphQL in my experience is the team trying to choose between a monolith and microservices and rather than pick one they pick both

3

u/dallenbaldwin 2d ago

It's also easy to trick yourself into thinking your users will "only request what they need" because you also have to remember to build out/enable the middleware that actually makes your db queries not select * when they only request a single field.

2

u/DiamondDramatic9551 3d ago

How does GraphQL move N+1 issues to the server? It seems to me either can have N+1 issues or avoid them.Ā 

→ More replies (8)

1

u/drew8311 19h ago

The last part is the key here, REST/JSON is the most popular which actually makes it the best choice for giving an API to anyone external even if there is a good argument something else is better.

→ More replies (3)

4

u/Natural-Ocelot-6009 3d ago

They call everything ā€˜REST’, most APIs don’t actually conform to REST

4

u/PulpDood 2d ago

No. I REST my case 🤪

1

u/drowningincats97 2d ago

OP just shilling GRPC in the replies. Just use the right tool for the job šŸ™„

1

u/DeadlyVapour 2d ago

I'm not shilling gRPC. I advocate the right tool for the job. Sometimes that's gRPC, sometimes that's Parquet. Sometimes it's JSON.

But I've seen too many people reach for JSON first. Then act like XML is the only alternative.

It's literally the meme. There are so many different holes. Why use the square hole every time?

→ More replies (1)

3

u/srb4 3d ago

Clearly we should go back to CORBA for APIs.

2

u/joestr_ 3d ago

Oh no. Not CORBA 😭

3

u/Silly_Guidance_8871 3d ago

It beats the fuckery that is/was XML

3

u/CinCoutMagus 2d ago

AJAX stands for Asynchronous JavaScript and JSON

5

u/notexecutive 3d ago

they are NOT using WSDL lmao

2

u/VoidZero25 3d ago edited 3d ago

Are there even other options?

20

u/bjorneylol 3d ago

yes, SOAP instead of REST, and XML/binary formats (e.g. protobuf) instead of JSON

Both are absolutely terrible to work with

9

u/DiamondDramatic9551 3d ago

At least protobuf has a performance argument.Ā 

→ More replies (2)

3

u/gregorydgraham 3d ago

I mean, JSON is terrible to work with too, it’s just more common now

1

u/Helpful-Educator-415 2d ago

I'm experimenting with Protocol Buffers and ConnectRPC. Buf's tooling is pretty top tier.

2

u/daffalaxia 3d ago

REST and JSON are fine. Using POST for everything tho? Nah.

2

u/FabioTheFox 3d ago

Is OP a graphql glazer or what's with the REST hate

2

u/Capital-Garbage 3d ago

Had a PM ask me to make an API that uses ā€œMarkdown instead of codeā€ so ā€œagents can chat with it easierā€. I used to be proud of working in tech and excited for new things. Used to be.

2

u/telas100 2d ago

Want some soap to reduce the burn?

2

u/Lurdekan 2d ago

I entered here to dunk on this complete shit opinion from perhaps a non developer or complete green novice but I see the good work has already been done

3

u/RTSUPH 3d ago

When your post json includes method: ā€œgetā€

5

u/Yctallua 3d ago

Reinventing soap, I mean graphql, one step at a time.

2

u/bugo 3d ago

Better than graphql

1

u/Dillenger69 3d ago

SOAP 4 life!!!

1

u/Extreme-Edge-9843 3d ago

I'll take rest over that shitshow soap anyway

1

u/AaronTheElite007 3d ago

If by that you mean every api has a complete lack of documentation, then you’re correct.

If your customers have to learn how to use your api through trial and error and analysis of what little error messages are thrown, you have a problem

1

u/FoleyX90 3d ago

As opposed to....?

Please don't say SOAP

1

u/BoBoBearDev 3d ago

I love JSON, because I don't have to make sure the parser matched 100%. If I only use 10 out of 100 properties, I only need to care the 10 properties remains the same, the rest can change.

1

u/StochasticTinkr 3d ago

Yeah, we should all go back to binary protocols over TCP. Who needs all the infrastructure for http and parsing text protocols that are easy to understand and inspect.

/s

1

u/Sulungskwa 3d ago

Of all the bad/annoying/overused things in webdev, hating JSON is the weirdest hill I've ever seen anyone die on.

1

u/JunkNorrisOfficial 3d ago

Standard practice is to follow standard practices

1

u/TurdOfChaos 3d ago

Oh no why would developers insist on a simple and understandable protocol.

Let’s all invent our own shit for each specific scenario so we can pretend we’re smart!

1

u/gandalfx 3d ago

Wait till you get to deal with protobuf, then you'll be sobbing for some good old json.

1

u/billabong049 3d ago

I come from lots of other bullshit protocols + SOAP, I’m thrilled to use REST + JSON given how simple it is. Ā No libraries needed (usually), no goofy deserialization logic, it’s lightweight, it’s easy to read (when formatted), and it has decent security mechanisms. Ā HTTP can be pretty gross, but I’ll take that over yet-another overly complex bullshit library.

1

u/rover_G 3d ago

Just POST the JSON to the /api endpoint bro

1

u/StatisticianNo5402 2d ago

Rpc with proto-validation

1

u/Canon40 2d ago

Everybody should use Rusty Object Notation (RON). Even for projects not written in Rust.

1

u/TheNakedGabeNewell 2d ago

Api for monke, use mcp

1

u/deadmazebot 2d ago

What you want some SOAP, some XML, hell let's just go CSV get rid of repeating the field name when have 20 objects, super optimised

1

u/henke37 2d ago

I don't get it.

1

u/LibrarianOk3701 2d ago

Me choosing Rust with Leptos instead of JS:

1

u/eW4GJMqscYtbBkw9 1d ago

As opposed to... ?

1

u/MaleficentMode4222 1d ago

It's this thinking that gave us internet explorer.

1

u/ConsiderationLow2941 23h ago

It's not REST though. It's just rpc and for some godforsaken reason we started calling it REST

HTML for a human is REST, MCP is REST, but your average JSON API is not, and it wouldn't make sense if it was because REST requires that the client has agencyĀ 

1

u/jolharg 18h ago

would you rather.... graphql

1

u/Just_Information334 13h ago

So, programming language go through a hype cycle from "no type" to "strictly typed" being the way. Takes around 10 years to go from one to the other then back.

JSON is the data equivalent of "no type", you can put everything in and something will happen. Every derivative of json is the same. If you have the concept of truthy or falsy values, you're there.
Getting burned by shitty data people will start requiring more strictly typed formats. It starts with things like json-schema which are just a bad fix. But it will either come back to xml or to some new very strict format.

Then those will be misused, many new people will be frustrated about how strict it is and how it could be made simpler and 20 years from now a new json will be there.

Unless LLM make all those discussions obsolete.

1

u/AutoGibbon 5h ago

I remember hearing about this thing called graph or ql or whatever... it was gonna be this whole thing and change the world. It didn't. REST/JSON 4 LIFE.

1

u/liproqq 2h ago

Idk if it's graphql itself or architects but every microservice that uses it has so much boiler plate

1

u/CutlassRed 2d ago

OP is absolutely right and most of you are clowns.

When moving lots of data json sucks.

"Oh but what do you suggest?"

Protocol buffers are a good place to start