views:

731

answers:

4

(Disclaimer: I asked this question yesterday on HN http://bit.ly/m6onk. While responses were good, there was a notable lack of technical discussion and more of a "you should use rails because that's what you know". Since Joel and Jeff state clearly they don't mind reposts of questions from other sites...and since I really enjoy the answers I find here...here goes)

Hi guys.

I realize this post is an infamous "versus" question, and undoubtedly redundant with older posts. However, most of the information I find on Rails versus Django is out of date and based on much older versions of the frameworks, so please forgive me.

First and foremost...I'm a Rails guy. I came to it three years ago and really enjoyed a lot of what it brought to the table. I'm not solely a Ruby guy...I have around 11 years of total experience, including Java, C/C++, Perl, Tcl, (some) Python, and more.

Anyway, I have an idea I believe will take over the world. I've already convinced a few folks it will as well and have friends and family funding to take on some offshore developers and get it in beta as quickly as possible.

Now, however, I am left with the decision of what tech to use. While I've really enjoyed Ruby...I'm growing tired of the magic, and the abuse of open classes. It's very nice when you need to inject some behavior quickly, but it can become a real pain when you have to maintain your project, or any of the plugins it depends on. I personally prefer Ruby over Python (largely because of blocks), but I envy the clarity-first attitude in the Python community. Given this frustration, I'm seriously considering a deep-dive into Django and using it for this project.

The pluses I see on the Rails side are:

  1. Size of community (which, given some of this "community" includes PHP refugees, is not necessarily a plus)
  2. My familiarity and experience
  3. Number of companies using it and striving to improve it
  4. Availability of offshore resources

Drawbacks of Rails include:

  1. Too much magic
  2. Documentation continues to be awful in places
  3. Inconsistent API
  4. Did I mention magic?

The (perceived) pluses on the Django side:

  1. Clarity
  2. Performance...I believe Unladen Swallow will really change the Python landscape and give it a competitive advantage
  3. Google's support of the language itself (see #2)

Drawbacks of Django:

  1. Learning curve
  2. Smaller community
  3. Slower development cycle of the project itself?
  4. (un)Availability of offshore resources

So, this is my thought process so far. I'm pretty comfortable I could come up to speed quickly on Django, and I have the basics of Python still in my memory somewhere. But I wanted to get your opinions as I really respect the vision and experience of a lot of the folks I read on here.

I appreciate your help. I really think this idea will take off, so it's very important to me to make the right technology decision.

And saying to choose Rails simply because I have experience there just doesn't sound right. If that were the case, I'd still be using Perl or C.

Thank you!

+5  A: 

You forgot at least one advantage of Rails -- enhanced testability via RSpec/Cucumber. Really, the main (additional) advantage is the attention to Ruby/Rails from the agile testing community. Using natural language testing should significantly enhance the ability to reason from your tests and promote understandability. In some respects this would offset the "magic" that you abhor by documenting it via easily readable tests.

Beyond that, I would suggest that a new project that you are spending your friends' and family's money on is probably not the ideal situation in which to learn a new language/framework. Why add the additional risk to an already risky venture?

tvanfosson
+1 for the second paragraph. Very good point.
Draemon
+4  A: 

I'm simply going to argue with many of your statements:

  • Django may have less magic than Rails, but there is still some there. Python is clearer though so you will gain clarity.
  • Django is renowned for being easy to learn, so I don't think Djangos learning curve is a problem.
  • Unladen Swallow is so far vapour ware. Never ever EVER make software decisions based on the promise that some software will be available in the future.

Since you already know Rails, you should stick with it unless you know it's going to be painful. Also, if you aren't happy with Rails, I would recommend you go through tutorials for some of the other Python frameworks in existance, like Turbogears 2, BFG and Grok. It may be that you would prefer something less monolithic or more complete that Rails/Django.

http://bfg.repoze.org/ http://grok.zope.org/ http://turbogears.org/

Lennart Regebro
The statement about Unladen Swallow is extremely valid - never make development decisions based on technology that MIGHT pan out - unless of course your development is of that technology...
Technical Bard
+6  A: 

[Repost from HN, same link as question, as I would like to hear your(you did not reply on HN) and SO response.]

I am obviously biased, as I run a django development company. That said, Ill start with answering the drawbacks of Django,

  1. Learning curve.: Not more than any other framework. Plus the Documentation is top notch. (The documentation was what sold me when I was evaluating.)

  2. Smaller community: Definately true. But beyond a critical size, size of community does not matter. Django is well above that size. (Irc: any given time ~200 Devs. Google group: 14000+ Users )

  3. Slower development cycle of the project itself?: Why? If you give more details, I can answer that.

  4. (un)Availability of offshore resources: Definately less than Rails, but still not as bad as you would have thought. A very small list, http://uswaretech.com/blog/2009/03/web-development-companies...

Thats said, given the information you have, I your case I would choose Rails. Even if most of the work you are looking to offshore, your existing Rails experience would be a huge plus, helping you evaluate vendors, keep track.

On a semi-related note, Django is less mature/smaller community is way overblown, some figures,

  1. Years under development. ROR: 5/Django 5
  2. Members in largest google group: ROR 18000+/Django 14000+
  3. Members in Irc currently: Ror 436/Django 401
  4. Commits to repo: Ror ?/Django 11000+
uswaretech
Thanks. I appreciate your response (I didn't reply on HN because I someone fat fingered my password twice when creating the account, and they give you no way to recover). I'm actually leaning now towards Django, even though many have recommended I don't. I appreciate it.
Parna
+4  A: 

Hi,

I've got a different perspective about these two frameworks on how they compare. I'm still a noob in these two as I am a Java developer looking for something more exciting to do on my sparetime. I have been observing these two frameworks closely and came up with this:

Rails

As you know Rails is born out of a web based application made by 37signals, which affects the architecture of if. I haven't really use Rails in real application yet though, but I think I might use it for my next pet project.

  1. Basically what I can see from Rails is that it is a monolith type of framework (Though this will change in Rails 3 as it will adopt Merb architecture). This architecture from my point of view will also affect the way you deliver/package your project. Monolith kind of project I reckon is good if you want to deliver all of the application in one bundle to your customer.
  2. As per the architecture, Rails use plugin if you want extend or add another feature. I reckon this is good if you want to have a community based product where user can add plugin.
  3. They said Ruby is slow, but then if you want to package Rails apps as a product, it's quite worted to package it as war file with JRuby and warble. E.g: Thoughtwork's Mingle use this approach.
  4. With that in mind, IMHO (well DHH also said this in Ruby vs Snakes conference too) Rails is suitable for web application.
  5. Rails has a good built-in ajax support (rjs). Django people it's easy to add Ajax support on django, but an abstraction like in Rails still makes it quite worth it I reckon.

Django

Django born out of a newspaper site, so in one way and the other that also affects the architecture of django itself. I've only used django in my sandbox website and so far I really like building websites with it.

  1. Most of the dirty work has been done for you (RSS Feed framework, Generic view, admin, commentig framework, etc)
  2. Django has an architecture of 'pluggable application'. Which is good if you want to plug already made django applications that is made by the community, or share those application at several of your sites.
  3. As I said if this is an internal/in-house websites I reckon it's really good to use django because you can re-use this apps in several websites. But it would be really tough to deliver this into one bundle type application because usually (well the best practice as I would say) this django apps lives in a PYTHONPATH instead of bundling it all together in your application. Though Pinax distribute the whole apps in one package, and I'm curious how Ellington does it.
  4. As the current Python is faster than the current Ruby(1.8), that makes django itself way faster than Rails (there's alot of benchmark about this on the web). With that kind of performance IMHO django is really suitable for high traffic websites (Think of twitter like traffic websites)

Some people might not agree for me, as they can find workaround to use Rails as websites and django as web application. But this is what I reckon distinguished the two based on their architecture. Thus it will also define what are they good for. Feel free to disagree with me :-)

Cheers.

jpartogi