3 ms·
This is a debate I've had many times. XML, and REST, are extremely useful for certain types of use cases that you quite often run into online. The industry aba
by _heimdall 9mo ago
This is a debate I've had many times. XML, and REST, are extremely useful for certain types of use cases that you quite often run into online.
The industry abandoned both in favor of JSON and RPC for speed and perceived DX improvements, and because for a period of time everyone was in fact building only against their own servers.
There are plenty of examples over the last two decades of us having to reinvent solutions to the same problems that REST solved way back then though. MCP is the latest iteration of trying to shoehorn schemas and self-documenting APIs into a sea of JSON RPC.
- locknitpicker 9mo agoYour comment doesn't sound well researched or thought all the way through. REST by definition is used nowhere at all, and virtually all RESTful APIs are RPC-over-HTTP that are loosely inspired in REST. There is virtually zero scenarios where anyone at all ever said "This thing we're using JSON for would be easier if we just used XML". JSON was the undisputed winner of a competition that never was in a great part because of the vast improvements over DX. I remind you that JSON is the necessary and sufficient subset of JavaScript that allowed to define data, and to parse it all anyone had to do was to pipe it to a very standard and ubiquitous eval(). No tooling, no third-party module, no framework. Nothing. There is no competition at all.
- ivan_gammel 9mo ago>REST by definition is used nowhere at all There exist plenty of people actually using REST. It can reduce complexity of SPAs.
- locknitpicker 9mo agoName one application which uses HATEOAS.
- _heimdall 9mo agoAny server rendered HTML site or application?
- ivan_gammel 9mo agoI have built a few. And of course there’s a lot of interest in the community around various HATEOAS specs. People build with HAL, Siren, JSON:LD etc.
- _heimdall 9mo agoYour argument isn't researched either, if your metric is based on including sources. You seem to be arguing that REST lost because if you look around today you will only find RPC. I agree. My point wasn't that REST won. Part of my point, though, was that REST lost and the industry has tried multiple times to bolt don't JSON RPC solutions to the same problems REST already addressed. If you would like to see some of those examples just look up Swagger, Open API, or MCP. I agree JSON won, and I agree that it was picked based on arguments over DX. I'm not sure where you and k disagree here.
- imtringued 9mo agoSwagger, OpenAPI have nothing to do with REST. In fact, they are the antithesis of REST, because they are the very out of band information that a REST client isn't allowed to depend on. A REST client for a pizza delivery restaurant isn't allowed to know that the "order" action is called "order", because that is out of band information. If the server is replaced by a hotel booking server with a completely different workflow, the client is supposed to continue working. Only MCP is loosely related to REST and it's because one of the defining characteristics of REST is that the API can be discovered at runtime, which is useful if you have a pseudo human level intelligence such as an LLM, but not if you have a dumb static application that has finite capabilities.
- _heimdall 9mo agoI was trying to say the same thing - Swagger and OpenAPI were attempts to solve problems that only exist because we didn't stick with REST. We wouldn't have needed Swagger if APIs were discoverable and self documenting.