Hacker News new | ask | show | jobs
by WilliamLP 5850 days ago
What I've never understood or appreciated about REST interfaces is that everywhere else in programming, the function / parameter / return paradigm is how we do things. Why do services over the web need to be different? It seems clear to me that something like RPC is what I want. (Which is not to say the particulars of XML-RPC or especially its implementations are anywhere close to ideal.)
2 comments

I agree, and it's certainly what I want as a developer.

But, if I was building a web service that was supposed to be widely used (maybe some like the Yelp or Facebook API), I might think about REST. You know it's going to be immediately understood by everyone, and you don't have to worry about weird dependencies. And, being able to show examples using just curl is kind of nice, too.

Well, keep in mind that when most people say "REST" what they mean is a web call that sends or receives JSON/XML.

Personally, I've found that there are some things that fit really well into a fully REST-ful design, but sometimes you just want to deal with JSON over http, and that's okay too.

I think I'm guilty of that. :-)

It took me a really long time to figure out what RESTful design meant. As best I can tell, it's CRUD mapped onto the HTTP verbs.

As long as you don't call it REST, then the purists shouldn't have a problem with it. I'm not a purist myself, I'm more about getting things done, and sometimes a useful API just doesn't map cleanly onto REST.