views:

1639

answers:

11

This is a(n) historical question, not a comparison-between-languages question:

This article from 2005 talks about the lack of a single, central framework for Python. For Ruby, this framework is clearly Rails. Why, historically speaking, did this happen for Ruby but not for Python? (or did it happen, and that framework is Django?)

Also, the hypothetical questions: would Python be more popular if it had one, good framework? Would Ruby be less popular if it had no central framework?

[Please avoid discussions of whether Ruby or Python is better, which is just too open-ended to answer.]

Edit: Though I thought this is obvious, I'm not saying that other frameworks do not exist for Ruby, but rather that the big one in terms of popularity is Rails. Also, I should mention that I'm not saying that frameworks for Python are not as good (or better than) Rails. Every framework has its pros and cons, but Rails seems to, as Ben Blank says in the one of the comments below, have surpassed Ruby in terms of popularity. There are no examples of that on the Python side. WHY? That's the question.

+7  A: 

I don't think it's right to characterise Rails as 'the' 'single' 'central' Ruby framework.

Other frameworks for Ruby include Merb, Camping and Ramaze.

... which sort of invalidates the question.

slim
Sort of. I could be wrong but I think that Rails is way more popular than other Ruby frameworks. No?
Yar
Merb is to be merged into Rails (it is already work in progress). Rails is THE Ruby web-framework regardless of how many others are out there. I would add Sinatra to the list http://sinatra.rubyforge.org/
J.F. Sebastian
Isn't that more an issue of phrasing rather than intent? Rails has very nearly eclipsed *Ruby* in terms of importance, let alone the other Ruby frameworks.
Ben Blank
It's true that barely anyone had heard of Ruby until Rails. It's almost (but not actually) as if Rails 'comes with a scripting language' as Cold Fusion does. But the question that raises is quite different from the one asked.
slim
+5  A: 

Rails was somewhat revolutionary in its extreme "convention over configuration" approach which set it apart from pretty much anything else and made it the "killer app" of Ruby, causing a lot of people to notice Ruby in the first place.

So the question is really "Why did David Hansson decide to write Rails in Ruby rather than Python?"

Michael Borgwardt
You don't want to hit that question, do you?
Yar
+5  A: 

Remember that Ruby had existed for a long time before Rails was created. According to Wikipedia, Ruby was created in the mid-90's; Rails didn't come around until 2004. Ruby is simply the language that David Hansson chose to use for Rails.

And yes, I would say Ruby is to Rails as Python is to Django.

David
I might invert that to: Rails is to Ruby as Django is to Python?
Ali A
While I completely agree that this is true for what Ruby has done for Rails (and Python for Django), it doesn't seem to tell the whole story as far as what Rails has done for Ruby. Ruby wouldn't be what it is today without Rails. Python would, without Django.
Ben Blank
Furthermore, why did Ruby get Rails and Python got... um, a whole bunch of frameworks? That's the HISTORICAL question.
Yar
David HEINEMEIER hansson...
DFectuoso
+1  A: 

Python is not a one-trick pony. Therefore, there's no single "central framework" for it. Many people first heard of Python as "another nice OO language" or through one of the many uses to which it has been put.

To be fair, Ruby is not a one-trick pony either. It's just that many people regarded Rails as the "killer app" that got them to look at a previously-not-well-known language. I suspect many people never heard of Ruby before Rails, but that's by no means the only thing Ruby can do.

joel.neely
That Python is not a one-trick pony is already present in my question. The question is WHY one developed with a whole bunch of frameworks and one with only one...
Yar
+30  A: 

As I see it, Rails put Ruby on the map. The simple fact is that before Rails, Ruby was a minor esoteric language, with very little adoption. Ruby owes its success to Rails. As such, Rails has a central place in the Ruby ecosystem. As slim points out, there are other web frameworks, but it's going to be very difficult to overtake Rails as the leader.

Python on the other hand, had a very different adoption curve. Before Rails, Python was much more widely used than Ruby, and so had a number of competing web frameworks, each slowly building their constituencies. Django has done a good job consolidating support, and becoming the leader in the Python web framework world, but it will never be the One True Framework simply because of the way the community developed.

Ned Batchelder
"but it will never be the One True Framework"... doesn't that contradict TIOOWTDI a little?
Corey Goldberg
@cgoldberg: Don't conflate language with frameworks/applications. In the Python language there is One Way To Do It. All the frameworks, applications, solutions, etc. aren't the Python language. Even the various implementations aren't the Language.
S.Lott
This is incorrect. Ruby owes some of its popularity to Rails, but you've overestimated its importance. As has the poster of this misguided question. I want to be clear on this: this answer is completely and utterly wrong.
Joshua Swink
+1 for completely and utterly wrong. Can't find an answer with evidence that refutes this answer.
S.Lott
Rails was released in July 2004.[Tiobe](http://www.tiobe.com/index.php/content/paperinfo/tpci/index.html) 2004 index for Ruby: 0.22%.2005 index: 0.317%.2006 index: 2.334%.2007 index: 3.084%.I don't see where I am wrong, I think the data bears out my thesis.
Ned Batchelder
References for previous comment (from archive.org):[Tiobe 2004](http://web.archive.org/web/20041211192830/www.tiobe.com/tpci.htm)[Tiobe 2007](http://web.archive.org/web/20071212021729/www.tiobe.com/tpci.htm), etc.
Ned Batchelder
Obviously, Rails wasn't popular in 2004, just as Java in 1995 or 1996 or even 1997 wasn't popular.
fuentesjr
Joshua Swink, could you answer the question better? I like Ned's answer because it actually answers the question, which is rare on SO. But I don't know if it's correct.
Yar
+5  A: 

I agree with Ned. I'd bet that more than 90% of Ruby installations are for no other purpose than running Rails. Rails dominates Ruby - there is no single application that dominates Python, mainly because the Python community is somewhat bigger than the Ruby community.

Salim Fadhley
I doubt the truth of your explanation, but it is an explanation, so I've upvoted it.
Yar
+2  A: 

Would ruby be less popular without Rails? absolutely.

Would Python be more popular with one true framework? You mean as opposed to several? May be, who knows. In any case most agree Django is a very good framework.

Why, historically, did it happen to Ruby? Because DHH chose Ruby after doing his own research.

To add to the answer regarding Rails having made a breakthrough because of 'convention over configuration' there is also another reason and that is that Rails has been using the meta-programming abilities of Ruby superbly. A lot of the magic of Rails which has contributed to removing a lot of the pain of developing web apps came through this clever use of ruby meta-programming.

allesklar
Fascinating... GREAT stuff. So the meta-lang stuff is missing in Python and Rails uses it to its advantage?
Yar
@DR - There are many meta programming techniques available to the Python programmer. Django makes extensive use of them in it's ORM and form implementations.FWIW, IMO Rails overuses metacoding techniques to the point of obsfucating functionality, acting very "magically" instead of explicitly.
Daniel
@DR Yes it is present in Python but DHH really took advantage of it very aggressively.Agree with Daniel that may be even to a fault.
allesklar
Fascinating stuff, thanks Daniel and Allesklar. The original question comes up out of my WTF moment, because I'm learning Ruby and Rails and everybody says, "no, python is cooler, but there's no rails." So why did that happen....? Interesting re: metaprogramming.
Yar
+5  A: 

The real technical answer is that there are three major approaches to web-development in Python: one is CGI-based, where the application is built just like an old one-off Perl application to run through CGI or FastCGI, e.g. Trac; then there is Zope, which is a bizarro overengineered framework with its own DB concept, a strange misguided through-the-web software development concept, etc. (but Plone is still quite popular); and then there is Django (and Turbogears, etc.), which is guided by the same just-the-tools-needed philosophy as Rails (it can be argued who got there first or who did it better). A lot of people would probably agree that the Django/Rails/CakePHP approach is better than the older approaches, but as the older language Python has a lot more legacy frameworks that are still trying to evolve and stay relevant. These frameworks will hang on because there is already developer buy-in for them. For example, in hindsight many people would probably say that Zope (especially ZODB) was a terrible mistake, but Zope 3 is much better than Zope 2, and there are already whole companies built around Zope technologies.

method
Wow. Fascinating answer on the Python side. So what was it? Ruby had no important frameworks before Rails?
Yar
+2  A: 

I'd have to agree that Django is basically the "Rails for Python" equivalent. Why did it take so long? The simple answer is too many options.

In Python, there are many request/response systems, url rewriters, ORMs, templating languages, etc. that you could build a web stack in dozens of different configurations. In fact, this is exactly what Pylons and TurboGears do is provide a reliable, predictable stack to build MVC web apps.

What Django did differently was they encapsulated everything. Rather than go the components route, they built one contiguous system. They built their own ORM, their own template language, their own middleware system, etc. Their reasoning was that there was no unified system like this for Python.

Soviut
A: 

If you followed the news, you have read that Merb and Rails will merge. This is a good move IMHO. I think it's because of the common goal that the developers have: They want a simple framework for webdev, which comes with a OR mapper, routing, template language, etc which fits for most tasks..

Nils
Who is "you" and which news are you talking about?
Yar
A: 

Check out this article on why we'll never see Python-on-Rails. The author gives some of the basic reasons why Python has never had and will never have a central framework. I might add, myself, that Java doesn't have one either, and for the same reasons.

According to the author, Rails is strictly tied to its "implementation," which is Ruby. Rails was adopted by many developers and Ruby was just part of it. Rails works perfectly on Ruby (or Ruby wanna-bes like Groovy), but more importantly, as many other answers say, Rails led the way to Ruby adoption.

This is why Rails-for-Python won't work, or at least what people have been focusing on with Rails isn't correct. It's not about the implementation or the quality of the framework, it's about the pattern of adoption. It's about putting the framework up front, and the implementation in the back -- even if this wasn't the Rails developers intentions (though maybe they are clever and this was their intention).

Basically, you can't get a bunch of language-loving folk to gather around a single framework. On the Java side, while Spring is well-loved, it's no Rails in terms of popularity in the Java community. In a mature community developers have their own ideas about what metaphors work and don't work in a framework. This is why Rails leads to Ruby and not the other way around (typically, mostly, not in all cases).

Yar