front and back-end web development, Leeds, UK
Richard's Blog - Design, coding and life in Japan
Django vs RailsSubmitted by Richard on Fri, 04/23/2010 - 13:47
Yes it is another one of those comparison blog posts! I apologize but I had to write something about this.
I have been a keen user Rails for the last 2-3 years and I do genuinely love it, beautifully crafted framework that gives you delight to see how simply and elegantly you can piece your web application together. Saying this I have had times I have got stuck and found out that sometimes you need to create un-elagant solutions to your code.
Rails 3 is trying to become everything Django already was!
I have just been reading a book a following the tutorials so this post may be a tad early. But what automatically struck me is wasn't this what Rails 3 is trying to be? The more heavily decoupled approach, using find filters and the like are new features coming into the Rails world but in Django they have been there for ages. Even i18n didn't show its face in Rails until version 2 upwards - How could this be an afterthought? Even the creator of Rails is Danish, why did you not think about this earlier?
I do feel locked in to Rails, using other libraries and gems feels like you are adding extra on what Rails is, where in Django you start with much more a bare skeleton anyway. Adding core Django functionality is just by including its class files. In Rails you are stuck to escape from the framework.
Is Rails/Rest truly DRY?
One of Rails' largest boasts is its leading in the REST approach, Django falls short on this, which would have bothered me, but I went on to think about this. So many of even our simplest controllers often look almost the same as another, same methods, same calls sometimes only different templates. In order to work with REST you need re-create the same methods over and over again no matter how similar they look! REST is amazing for an API but I am not 100% convinced about it for all occasions, or could a DRYer implementation of REST be attainable?!
Django is decoupled and DRY, Yes I will be using it!
Python may not be as art-sy and elegant as Ruby but I would say in terms of simplicity and usability it is way up there. I love the simplistic bare bones approach of Django and have one site in mind on which I will step it through its paces. It seems logical and concise - which steps away from the code is art thing a little. It gives you more namespace and file layout options which may not bring too much benefit, however in Rails this lead me to stop exploring as much as I could.
Do I recommend Django
As a newbie it seems far more logical to work out than what I remember of when I learnt Rails, for new users I would definitely recommend it (even if the MySQL adapter was a pain to install on the Mac). I am looking forward to using this framework! I still love Rails, I will still be using it, but I am glad to have alternatives that are ready on the shelf also!!
Recent Blog Posts
- Testing controllers in Lithium 2nd Feb 12, 18:19
- Practical Internationalization in Lithium 31st Dec 11, 02:06
- Using OAuth in Lithium 30th Dec 11, 23:47
- How to add your own Tokens from CCK fields in Druapl 7 17th Jun 11, 04:49
- Weaving Lithium #li3 into a legacy PHP application incrementally 5th Oct 10, 11:54