views:

366

answers:

7

So this thread is definitely NOT a thread for why Python is better than Ruby or the inverse. Instead, this thread is for objective criticism on why you would pick one over the other to write a RESTful web API that's going to be used by many different clients, (mobile, web browsers, tablets etc).

Again, don't compare Ruby on Rails vs Django. This isn't a web app that's dependent on high level frameworks such as RoR or Django. I'd just like to hear why someone might choose one over the other to write a RESTful web API that they had to start tomorrow, completely from scratch and reasons they might go from one to another.

For me, syntax and language features are completely superfluous. The both offer an abundant amount of features and certainly both can achieve the same exact end goals. I think if someone flips a coin, it's a good enough reason to use one over the other. I'd just love to see what some of you web service experts who are very passionate about their work respond to why they would use one over the other in a very objective format.

+4  A: 

I know Ruby, don't know python... you can see which way I'm leaning toward, right?

nowk
Fair enough, again, this isn't out of line. Answers like this further solidify that flipping a coin is legit.
randombits
I apologize, the answer came out a bit brash, but it was not meant to be. ...internet. But when you ask to choose between 2 very competent languages, it does more or less become a coin toss. And what determines the faces of that coin is the languages available to you.
nowk
+4  A: 

Choose the one you're most familiar with and most likely to get things done with the fastest.

toluju
Also fair response given the question. Thanks!
randombits
+4  A: 

Yeah, flip a coin. The truth is that you're going to find minimalist frameworks in either language. Heroku is a pretty strong reason to say Ruby but there may be other similar hosts for Python. But Heroku makes it stupid easy to deploy your api into the cloud whether it's Rails or some other Ruby project that uses Rack. WSGI doesn't give you this option.

As for as the actually implementation though, I'm guessing that you'll find that they're both completely competent languages and both a joy to program in.

Chuck Vose
If you're looking for something equivalent to Heroku for Python, I'd say that Google App Engine is a good bet.
toluju
Awesome, I'll check it out. I had forgotten that they run Python! Very exciting.
Chuck Vose
+1  A: 

I would say the important thing is that regardless of which you choose, make sure that your choice does not leak through your REST API. It should not matter to the client of your API which you chose.

Darrel Miller
+1: Good idea for an objective criteria. It makes the language decision moot, which is an excellent additional point.
S.Lott
+1  A: 

I think they are fairly evenly matched in features. I prefer Python, but I have been using it for over a decade so I freely admit that what follows is totally biased.

IMHO Python is more mature - there are more libraries for it (although Ruby may be catching up), and the included libraries I think are better designed. The language evolution process is more mature too, with each proposed feature discussed in public via the PEPs before the decision is made to include them in a release. I get the impression that development of the Ruby language is much more ad-hoc.

Python is widely used in a lot of areas apart from web development - scientific computing, CGI rendering pipelines, distributed computing, Linux GUI tools etc. Ruby got very little attention before Rails came along, so I get the impression that most Ruby work is focused on web development. That may not be a problem if that is all you want to do with the language, but it does mean that Python has a more diverse user base and a more diverse set of libraries.

Python is faster too.

Dave Kirby
"I prefer Python, but I have been using it for over a decade so I freely admit that what follows is totally biased."That kinda contradicts with the title of the post, doesn't it? randombits wants objective, i.e. non-biased, opinion, and yet you freely admit that your opinion is biased and then proceed to give it anyway. Come on.
Srdjan Pejic
@Srdjan Pejic: Please provide an example of an "objective" determination for selecting a programming language. Asking for "objective" is nice, but actually providing an actually objective measurement is a different thing. Perhaps you know of an actual objective measurement? If so, please suggest that measurement when noting that something isn't "objective".
S.Lott
ALL opinions are biased by the opinionator's knowledge and experience. However most of the things I mentioned could be objectively meaured - there are plenty of benchmarks showing the overall Python is faster than Ruby. Whether that is important to you is a matter of opinion. Similarly the number of Python/Ruby libraries and their distribution on various problem domains could be objectively measured, although I have not done so. Again whether that is important or not is going to depend on the needs of the individual.
Dave Kirby
A: 

Either will do a great job and you'll gain in other ways from learning something new. Why not spend as couple of days with each? See how far you can get with a simple subset of the problem, then see how you feel. For bonus points report back here and answer your own question!

Mike Woodhouse
+1  A: 

Ruby + Sinatra

Very easy to use with/as rack middleware - someone's already mentioned heroku

Mike