wild_egg 6 days ago

Deja vu with this blog. Another overengineered abstraction recreating things that already exist.

Misunderstanding REST only to reinvent it in a more complex way. If your API speaks JSON, it's not REST unless/until you jump through all of these hoops to build a hypermedia client on top of it to translate the bespoke JSON into something meaningful.

Everyone ignores the "hypermedia constraint" part of REST and then has to work crazy magic to make up for it.

Instead, have your backend respond with HTML and you get everything else out of the box for free with a real REST interface.

4
danabramov 6 days ago

>Another overengineered abstraction recreating things that already exist.

This section is for you: https://overreacted.io/jsx-over-the-wire/#html-ssi-and-cgi

>Everyone ignores the "hypermedia constraint" part of REST and then has to work crazy magic to make up for it.

Right, that's why I've linked to https://htmx.org/essays/how-did-rest-come-to-mean-the-opposi... the moment we started talking about this. The post also clarifies multiple times that I'm talking about how REST is used in practice, not its "textbook" interpretation that nobody refers to except in these arguments.

wild_egg 6 days ago

> This section is for you: https://overreacted.io/jsx-over-the-wire/#html-ssi-and-cgi

Strawmanning the alternative as CGI with shell scripts really makes the entire post that much weaker.

> nobody refers to except in these arguments.

Be the change, maybe? People use REST like this because people write articles like this which uses REST this way.

danabramov 5 days ago

>Strawmanning the alternative as CGI with shell scripts really makes the entire post that much weaker.

I wasn't trying to strawman it--I was genuinely trying to show the historical progression. The snark was intended for the likely HN commenter who'd say this without reading, but the rest of the exploration is sincere. I tried to do it justice but lmk if I missed the mark.

>Be the change, maybe?

That's what I'm trying to do :-) This article is an argument for hypermedia as the API. See the shape of response here: https://overreacted.io/jsx-over-the-wire/#the-data-always-fl...

I think I've sufficiently motivated why that response isn't HTML originally; however, it can be turned into HTML which is also mentioned in the article.

timw4mail 6 days ago

The hypermedia constraint is crazy magic itself. It's not like HATEOAS is fewer steps on the application and server side.

nsonha 4 days ago

I have yet to see these mythical HATEOAS compliant applications, they must be so amazing and simple, example anyone?

And if it turns out that there is no such thing, should I conclude that all these people talking about it really just base their opinion on some academic talking points and are actually full of shit?

nsonha 4 days ago

> have your backend respond with HTML and you get everything else out of the box for free with a real REST interface.

speak like someone who's never made a real product. Please enlighten us on how you add interactivity to your client, which flavour of spaghetti js? How do you handle client states, conveniently everything's on the backend?

aylmao 6 days ago

We already have a way one way to render things on the browser, everyone. Wrap it up, there's definitely no more to explore here.

And while we're at it, I'd like to know, why are people still building new and different game engines, programming languages, web browsers, operating systems, shells, etc, etc. Don't they know those things already exist?

/s

Joking aside, what's wrong with finding a new way of doing something? This is how we learn and discover things.