Tell me more ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I'm learning about REST and had the chance to build a basic REST API. After doing so, most of the material I read was internalized and I now have a better understanding of it.

However, I do not see any real difference yet as to the tangible benefits of using REST over the old way I was doing things, which was simple URL query strings. It seems they both do the exact same things. But with REST, it's cleaner, and standardized.

I thought REST had additional technical benefits. If they do, what are they? Or is REST simply that - an agreed way to implement and API?

share|improve this question
3  
Since HTTP is a RESTful architecture, the question should be 'what can HTTP do that REST cannot?' –  rath Jul 24 at 14:51
 
there's more to an API than GETs –  bye Jul 24 at 20:16
add comment

2 Answers

up vote 6 down vote accepted

There are no additional technical benefits. Many people simply think using a RESTful style makes for a cleaner interface. If nothing else, consumers can usually make inferences about how a RESTful API works (GET to fetch data, PUT and POST to create or save data, DELETE to delete, etc), whereas with random query strings they have to read the documentation a bit more closely.

share|improve this answer
add comment

REST is not about functionality, but about style. The idea behind it is not that it allows anything new but that it makes the API easier for people to learn and understand, and that it also makes for shorter, more readable URLs.

The other thing to keep in mind is that REST doesn't mean "no query parameters". The idea is that in most APIs, a lot of the information is by nature hierarchical and so for that information, why not use the hierarchical structure inherent in an URL? It makes the hierarchy explicit and this in turn often makes for more an API that is more flexible. (Because it makes the developer think in hierarchical terms.) Too often APIs based on parameters end up being an unholy mass of poorly organized options.

This is a "tangible benefit". Good coding style in any domain can have direct impact in productivity and defect reduction. Clear, consistent style in an API is especially important because an API is something that many developers will use, and something intended for use by the people who did not design and code the software.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.