| > 1. What does Rails do that Django doesn't? The answer is, basically, "Have a larger ecosystem without being Java." There are a few things each has by default that the other doesn't, but by and large I don't think people pick Rails because it has 8 million features and Django only has 7.95 million. > 2. Why hasn't the Python community seen whatever Ruby's doing and copied whatever makes Ruby popular? Are there any Python/Ruby experts reading this who are willing to port or reimplement the good parts of Ruby in Python? Just about anything worthwhile already has an equivalent. The reason Ruby is popular is not really about features. Ruby is popular because Ruby managed to capture people's imagination. When the new generation of webdev was first coming around in the mid-2000s, Ruby had a huge burst of enthusiasm. Everybody was enamored with Ruby on Rails, and Ruby itself had lots of fanatical evangelists like Why who were eager to teach people. Python, ironically, was hampered by the fact that it was more mature and thus it was harder to get people excited about it. Additionally, Rails was the killer app for Ruby, while Python took a relatively long time to put out a comparable product. I don't remember if Django existed, but there certainly wasn't the situation you have today where Django is basically the "Python Rails" and they're seen as being on roughly equal footing. Instead, Pythonistas were all talking about how you should take Twisted and twelve other libraries and you just write all this glue code and then it's sort of like Rails if you squint really hard — and nobody really found that exciting either. This isn't to say that Ruby doesn't have actual benefits to recommend it. Rails is a very nice, mature environment for web development, and Ruby as a whole has a very nice ecosystem these days. But the reason it got where it is is because Ruby won people over eight years ago, and it's gotten where it is today from that momentum. It isn't that Ruby is miles ahead and Python is simply inferior, but that Ruby just got a head start in that field and inertia matters a lot. > 3. Are there any other reasons to prefer Ruby over Python besides Rails? For example, do Gems do things that are impossible with Pip? The culture of the two languages is sort of different. Python invariably loves explicitness. Ruby isn't as crazy infatuated with "magic" as it used to be, but it's still much more acceptable over there to do weird tricks that let you write code the way you want to (e.g. "this magically executes in a context with functions that aren't available elsewhere") instead of the old-fashioned way. A lot of people prefer the latter, so they like Ruby. A lot of other people hate that kind of code, and they will be much happier using Python. |
This is the most informative part of your comment. I came to Python around version 2.6, and Django was already pretty near its modern form. I also first started hearing about Rails at that time, so my perception was "Python has always had Django, and Rails is a new thing." If Rails is older than Django, that explains much.
> Python invariably loves explicitness
Before I used Python, Java and C were my main languages. I was amazed at how short programs became in Python. For this reason, saying "Python loves explicitness" strikes me as strange, since it gets rid of braces, semicolons, variable declarations, the 'new' operator...
> A lot of other people hate that kind of code, and they will be much happier using Python.
This is totally me. I've ranted elsewhere in this thread about Ruby's syntax. Maybe some clever person will write a Python-to-Ruby translator someday so you can use Rails without having to deal with Ruby syntax.
> inertia matters a lot
I'm just a little surprised the momentum isn't swinging back to Python. Since IMHO Ruby's syntax makes the language...very undesirable, and if I was forced to use it to take advantage of tools that only exist in Ruby-land, I'd be looking to switch back to Python as soon as the tools were ported -- and even devote effort to helping with ports.
Everybody was excited about Perl in the beginning, but very few people still code in Perl these days. I think Ruby suffers from similar problems and will eventually be eaten by Python.