this post was submitted on 20 Nov 2024
50 points (94.6% liked)

Programming

17677 readers
38 users here now

Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!

Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.

Hope you enjoy the instance!

Rules

Rules

  • Follow the programming.dev instance rules
  • Keep content related to programming in some way
  • If you're posting long videos try to add in some form of tldr for those who don't want to watch videos

Wormhole

Follow the wormhole through a path of communities !webdev@programming.dev



founded 2 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
[–] freagle@lemmygrad.ml 6 points 1 month ago (2 children)

Honestly this is completely ridiculous. Hypertext using HTML constraints is absolutely insufficient for representing application state. It's the wrong tool for the job and always has been, because it conflates document structure with semantic meaning.

Said another way, HTML cannot be relied on to capture a representation of application state.

The reason REST doesn't use HTML in most contexts is because applications don't use HTML in most contexts anymore.

Demanding that application representation use a specific encoding strategy is ridiculous and misses the point entirely, which is that HTTP is no longer the right protocol for the job.

[–] Slotos@feddit.nl 5 points 1 month ago (1 children)

While HTML is hypertext markup language, hypertext is not HTML.

Hypertext doesn’t imply a specific encoding strategy, it implies semantics - data contains links to related data. If you want to encode it in protobufs - you do you, REST explicitly calls for freedom in this regard.

To paraphrase yourself, ranting about HTML as if it was a requirement for REST is ridiculous and misses the point entirely.

PS: HTML is not a protocol.

[–] tyler@programming.dev 1 points 1 month ago

Yeah which you can do with JSON as well. GitHub’s API does exactly that, providing links to all the rest of the resources so the client doesn’t need to “know anything”.

The author of the article completely conflates JSON with “JSON == Not-REST” which couldn’t be further from the truth (also calling json apis “RPC” is fucking hilarious to me. I can tell the author has never touched actual RPC). JSON was standardized on because it encoded the information that was in html in a much smaller format and allowed a backend server to communicate with any client, not just a browser (not that other clients can’t use html or xml, but they didn’t want to because they might not be documents). Dealing with xml is a nightmare. JSON made that better, and still allowed you to do HATEOS if you really wanted to.

[–] Kissaki@programming.dev 1 points 1 month ago

They're not demanding anything. They're describing how the current meaning of REST is nothing like the original one.

They're making a point for not splitting application state and logic into client and server with shared knowledge. If you're making that a pretext of course their argumentation won't fit. They're describing an alternative architecture and approach. Not an alternative protocol for the current common web application architectures.