← Back to context

Comment by hombre_fatal

4 hours ago

> it's a question I ask and almost never hear a coherent answer to.

There are a lot of coherent answers though.

One is that responding with HTML encumbers the server with brittle UI over the wire when it could instead be a simpler API server that any client can talk to.

Returning data instead of UI from the server is a clean separation of concerns.

There's nothing incoherent about that.

That's the theory. In practice, if your UI is changing a lot, the data your UI needs is also changing a lot, meaning that your data API will either have a lot of churn or you'll allow a lot of flexibility in how untrusted clients can use it, which introduces it's own pile of issues.