Hacker News new | ask | show | jobs
by arohner 5857 days ago
My sibling poster is dead on that 'normals' don't care about URLs. Often, I don't either. In my app, I have a bunch of "real" web pages, and then a bunch of "accidental" URLs that only exist to handle ajax requests. These aren't real pages, and what they return is of no value to the user unless they're on the page that generated the ajax call.

I don't want to go through the process of creating a new URL, figure out what its parameters will be, and then map those HTTP parameters to arguments to a server-side function. I want to magically link a client side action to a call on the server that may perform a side effect or return HTML, or both. The URLs are an implementation detail that I'd rather not think about.

1 comments

If you care about REST (and arguably you should) then URLs are not an implementation detail. Especially if you are creating an API that others may eventually use to get at your data, URLs are everything. I'll say it again: the application is the URLs. Because ultimately the application is its resources and simple manipulations of them, which the URLs are representing.
You simply do not understand REST. At all.

Caring about what URLs look like is at best irrelevant, but normally extremely counterproductive to actual RESTful implementation. If you're building URL strings to make requests (save for get-based forms) anywhere in any of your clients, you're doing it wrong. Wanking about pretty URLs just encourages you to go in the wrong direction.

In true REST, URLs are opaque identifiers. They might as well be UUIDs. The only way you're supposed to get one to request is in a response from the server.

Hypertext. Is. The. Engine. Of. Application. State.

This is unnecessarily personal and offensive. Note that I never said URLs must be pretty.