|
|
|
|
|
by csense
4772 days ago
|
|
I'm interested in the answers to these questions: 1. What does Rails do that Django doesn't? (Feel free to substitute any other Web framework for Django if you think it'll help your answer be more illustrative.) 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? 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 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.