top | item 8002061

(no title)

jarrett | 11 years ago

My take on Ruby vs Python is this:

While Python has a healthy web dev ecosystem, Ruby's feels much larger to me. That's almost certainly because Rails is so wildly popular. And Rails is an excellent, mature framework. So for web dev, I would consider Ruby the winner.

Python is the clear winner for scientific computing. That's not really due to anything inherent in the language. It's an ecosystem thing. If you were using Fortran before, you might be working in a problem domain where Python dominates.

Both are excellent for miscellaneous scripting work. E.g. reading in a CSV file and doing something with each row; batch-processing a bunch of images; renaming 1000 files according to some ruleset; gathering some system data and sending nightly status emails.

In terms of syntax and features, they're very very similar. Python has meaningful whitespace, which you may like or dislike. (I think it's good for enforcing proper formatting, but you're free to disagree.) Ruby has multiple ways of expressing the mathematical concept of a function (methods, blocks, and procs), which has its pros and cons. Both have metaprogramming facilities, though I find Ruby's more pleasant. If I remember correctly, it was in large part the metaprogramming that made DHH pick Ruby for Rails.

discuss

order

franparga95|11 years ago

I kind of see what you mean :) at my university they announced a python course for developing Computational Fluid Dynamics programs (aerospace engineering), so my first vision of Python wasn't too much for web development but for engineering/scientific programming like fortran is. Although it's a popular choice for web apps. After having worked with fortran I found a bit more attractive Python because of all the indentation and syntax style. I also read that Paul Graham likes a lot more python haha

But many other readings and the fact twitter and groupon were coded in ruby, made the choice! I've read that twitter now is moving to scala, but as there are a lot more resources out there for learning ruby/python, I kicked it out of the list.

I like ruby, sometimes it seems a bit confusing when there are many ways to express the same thing, but it's approach to natural language is helpful.

Thank you all for your quick responses! It's a pleasure to join the HN community!!

toyg|11 years ago

> While Python has a healthy web dev ecosystem, Ruby's feels much larger to me.

It's funny because I actually feel the opposite: Ruby is mostly a niche language for the web community, whereas Python is now mainstream in so many different areas (graphics, scientific, sysadmin, financial...).

I've yet to see a non-webdev tool embedding Ruby as a scripting language, while Python is now featured in office suites, spreadsheets and enterprise software. Anywhere simple and clear syntax is more valued than metaprogramming features, Python is likely to appear at some point.

jarrett|11 years ago

I think we have almost the same opinion, actually. I said Ruby's "web dev ecosystem...feels much larger to me." I agree that Ruby's strongest niche is web dev. And I think it has an edge of Python there. Outside web dev, I don't see Ruby dominating any particular niche.

crdoconnor|11 years ago

>While Python has a healthy web dev ecosystem, Ruby's feels much larger to me.

What is there in, say, rails that would not be available for django?

jarrett|11 years ago

It's not a Rails vs Django feature comparison that gives Rails the edge. Convergent evolution means they're pretty much on par with each other all the time.

The difference is in the size of the ecosystem as a whole. The Ruby web dev world appears to have more (or more visible) participants. Which affects things like Stack Overflow, web-specific packages on Github, blog posts, etc.

It's not an order-of-magnitude difference, as far as I can tell. But still significant.

sejje|11 years ago

Stack overflow QAs covering virtually every possible problem you'll encounter.

I much prefer Python/Django, but when I get stuck, it always lasts longer.