Rails vs Django. Thoughts?

Mahzkrieg

New member
Nov 13, 2007
585
31
0
Austin, Texas
In an effort to superficially compare PHP (with CodeIgniter), Rails, and Django, I've been working on an identical application in all three frameworks.

So far, the website is almost fully built in Django and CodeIgniter but I'm just starting my Rails version.

py1.png
My thoughts on Django
  • Auto-generated administration backend is great. I can imagine it saving a lot of time in more complicated applications.
  • Django documentation is all in one place. In fact, the community seems to be all in one place.
  • One big Pythonism is that there's "one way to do it". While this isn't something you can only agree to disagree on, I actually liked Ruby's (Lisp's) approach of "many ways to do it".
  • LOVE nested-code dependent on tabs/spaces versus { and }. Going back to {} for my PHP app was painful and felt old-timey.
  • Dislike Django's Model Template View (MTV) design. Not having classic Controllers just felt wrong. In fact, Djangos file structure wasn't even intuitive to me when I first created the project.
  • Disliked Django's native templating engine, but changing it was easy.
  • Django doesn't change rapidly like Rails does. There seems to be more security.

rails-e1285493885285.png
My thoughts on Rails
  • Documentation/tutorials/solutions were far more decentralized, scattered. But I actually found the documentation and resources were ultimately better and better presented, which is huge to me.
  • Love Ruby's "many way to do things" approach.
  • Ruby's package manager (gems) is super easy. Feels like a more intuitive aptitude/apt-get.
  • The Ruby community is united over one framework. Not necessarily a good thing, but, for example, Rails has twice the activity of Django at Stackoverflow. BUT, it's actually impressive that Django has half. I also get the impression sometimes that the average Django Pythonist is more experienced than the average Rails Rubyist.
  • HAML is a beautiful markup generator (just click it and see the demonstration on the bottom)
  • Rails feels less coupled than Django. It was easier for me to modify Rails modularly than it was for me to edit Django.
  • Rails changes a LOT. Rails 2 --> Rails 3 has some very big structural changes. Meanwhile, Django has slowly arrived at 1.2.x which gives the impression that Django is a more lasting framework.
  • I've seen people complain about older Rails being hard to deploy, but thanks to RVM, Rails is even easier to deploy for me than Django. Capistrano and Heroku, too.

SuperEliteWinner64.png
: Rails

Just kidding. Who cares? Those are just a bunch of topical impressions and a lot of general inexperience and ignorance, but I dabbled in both, got a small feel for each community, documentation access, etc., and those are my impressions.

What really sells Rails to me is the documentation. Yeah, maybe it changes a lot (I feel fortunate to hop in on Rails 3), but new books come out fast and there are some real powerful contributors to the growth and education of the community. Railscasts in particular allures me. Ryan Bates, the guy who throws it, is one dedicated motherfucker.

I'm most motivated to work on Rails right now, but really, I'll work on either. And ideally, I'd work on both. I don't like the mudslinging and the snobby attitudes of both communities towards eachother.
 
  • Like
Reactions: uplinked


Awesome write-up, I'm stoked to see you're actually coding side-by-side comparisons.

Right now, I'm building one project in Rails 3 and two more projects in Django 1.3; I pretty much agree -- The difference between them is massive, but they're both well fit for web development.

I like Rails for it's ecosystem and plugins (specifically HAML for templating and the ease of creating a new project) but once you get Django up and running (and tweak the fuck out of your settings.py) the tools are at least as good and the "average developer" is (I agree with you) maybe a little more talented.
 
I use Django for most of my sites, and some things were a huge pain in the ass to deal with(multiple sites). But at this point I can just hack around whatever problems come up fairly quickly.

I think 'the best 'framework is going to be dependent on which language you're most comfortable with because eventually you'll have problems and spending hours on stuff that should be trivial is no fun.

I'd like to build something in Rails but learning Ruby doesn't seem like the most productive use of my time when Python is so similar.
 
I use Django for most of my sites, and some things were a huge pain in the ass to deal with(multiple sites). But at this point I can just hack around whatever problems come up fairly quickly.

I think 'the best 'framework is going to be dependent on which language you're most comfortable with because eventually you'll have problems and spending hours on stuff that should be trivial is no fun.

I'd like to build something in Rails but learning Ruby doesn't seem like the most productive use of my time when Python is so similar.
Mostly agree, except the last sentence. The "most productive use of your time" is in leveraging the best tool for the job at hand.

IMO even after writing Python code, writing Ruby "feels" blistering fast, like maybe even half-as-many-keystrokes fast. Writing Python, on the other hand, "feels" more declarative and less prone to errors (while still using 1/10 the keystrokes vs. PHP), but the Ruby emphasis on shorthand is so, so nice. It really is the little things, like not having to define return values (the last line of the function gets returned) and not having to type parenthesis when they're obvious, not to mention rails generators. RoR makes rapid prototyping and building powerful frontends really super fast, but these "features" can all lead to code-confusion down the road, and I prefer Python for anything backend-ey or complex, because it keeps me sane, and Python's inherently better at dealing with anything involving math, science and large data (because of numpy and similar).
 
Out of curiosity, have you looked at using something like Codeigniter (PHP) for the backend CMS and main website and then just letting Python do the heavy lifting when the scripts call for it?