4 ms·
> I disagree that it isn't an API, but that's a definition quibble. I don't understand: An API is an application programming interface, i.e. it is meant to be
by codethief 4y ago
> I disagree that it isn't an API, but that's a definition quibble.
I don't understand: An API is an application programming interface, i.e. it is meant to be consumed by other programs. How does that go together with
> REST and HATEOAS are for humans
?
And how does that go together with the requirements of "no interpretation needed" and therefore "little coupling" between client and server that were mentioned in the article? Any API must be interpreted by the calling application – i.e. the caller must know what they are calling and what responses they might get. Otherwise they cannot do anything useful with it – at least not in an automatic (programmatic) fashion.
I really don't understand how something can be a REST API on the one hand (clear, well-documented interface; used for programming), and on the other hand is supposed to be "for humans" and devoid of "interpretation" on the client's part. (Leaving aside that, even if this were possible, the interpretation would simply be done by the very final client of the API: The human.)
All in all, I simply fail to see how ideas like "REST is for humans", HATEOAS etc. are supposed to be actionable in the real world.
- recursivedoubts 4y agoA concrete action I would suggest is splitting your data API out from your hypermedia API: https://htmx.org/essays/hypermedia-apis-vs-data-apis/ https://htmx.org/essays/hypermedia-apis-vs-data-apis/ Use hypermedia (and, who would have guessed I'd recommend this? something like htmx) to build your web application. Use GraphQL or whatever other nonRESTful technology fits best to build your data API.
- Sohcahtoa82 4y agoIsn't this just server-side rendering, just doing sections of the page rather than the full page? Looks like it's encouraging coming almost full circle back to web 1.0 where all HTML was generated by the server.
- recursivedoubts 4y agoYes.
- chazu 4y agoAn API is also the interface used by humans to create programs. When you use a library, you're using its API. This sense of the term API is often lost.
- codethief 4y agoTrue, but in this sense every code, every library and every API would be "for humans", which renders this distinction rather useless.
- chazu 4y agoNot sure what you mean. Sometimes the word API is used in one sense, sometimes in another. It's a useful distinction insofar as it allows you to talk about APIs as things used by programmers. I find many developers have a hard time understanding this sense of the word API and as a result fail to apply good API design principles such as SOLID. In fact I think this is often what separates mediocre programmers from good ones.