Ask HN: The best language for writing RESTful APIs?
I've used flask, rails, and padrino (sinatra).
Flask was my favorite but is hard to keep organized without much of a toolkit or recommended dev patterns baked in. I recognize that blueprints really help, but a consistent cross-project organization would be nice.
The transition to padrino was welcomed due to a lot of basic structure that is consistent in all projects, but unsustainable due to a functionally dead community (#sinatra has 25 people at max and nobody talking, #padrino has maybe 8).
Rails is far too much bloat to just be serving JSON (benchmarks show that sinatra is 4-8x faster...) and implies TOO strict a structure to development (also, being a python person...I don't appreciate magic).
What do you recommend?
21 comments
[ 3.5 ms ] story [ 115 ms ] threadThe other disadvantage of using Node is that the ecosystem is still not completely agreed on what to use--for my 0.02USD, I'd look into HAPI + Swagger.
Also, if you don't know about promises or generators, you're going to write really really ugly Node code. That said, it's pretty easy to pick up.
As for a guide... There's a guide for LoopBack specifically here: http://docs.strongloop.com/display/LB/Getting+started+with+L... That framework was written specifically for writing REST APIs.
As far as organization of code is concerned openresty does not impose any restrictions on you. But since it is just lua you can bundle you code into modules. And then you can use those modules using "require" much like in node js (though it is slightly different)
Also there is lapis[1] and sailor[2] if you are looking for something more organized.
[1]https://github.com/leafo/lapis [2]https://github.com/Etiene/sailor
Does it matter 1 bit? If you can't demonstrate that it does, you might as well choose the framework with the best mascot and Django's mascot is pretty damn awesome.
Django, similarly to rails, has far too much bloat and is tediously layed out. An entire rant aside, Django is becoming increasingly unpythonic and more rubylike, imo.
I'll have my Rails API up in half the time. Why worry about scaling before you have to?
In addition, I would say the mentality of scalability when constructing applications is part and parcel of the design ideology of ruby, but too often far removed from its practice.
I see no reason to prefer Rails API. It is a reverse-frankenstein situation whereby they had the monster, and started removing limbs...
Aisel based on principles of REST architecture combines two different and independent frameworks - Symfony2 with a robust PHP community and progressive AngularJS.