Let me start this post off by saying that I love Ruby. And, I really, really, really want to love Rails. I've wanted to love Rails for so long. Ruby fits the way I think like a glove and for that reason, and that reason alone, I've been wanting to really love Rails for so long. I've had many little trysts with Rails now and I still can't seem to give her the respect she needs. Rails, for lack of a better metaphor, is my booty call, but Django is the girl I bring home to meet my Mom. Rails is magical and sexy, it's the Ferrari of web frameworks, it's the foul mouthed, sullen browed, twenty-something on the sport bike. Django is more of a refined tool that is only really appreciated with experience. Django is the Bentley, the Aston Martin, the Rolls Royce of web frameworks. I'm pushing 34 now, I drive a Honda Accord, and very recently a Vespa scooter. In other words, I'm not looking for a Ferrari, I'm looking for the Aston Martin.
So when did this love affair with Django begin. Well it all started with a simple little request from my wife that, being the self respecting engineer that I am, I turned into a month long project. Her request? Help her take some data in Excel and display it as a bar graph. Well, of course, this was just too tempting an offer for me. I hate working in Excel and I've been looking for a good project to really get to know another web framework. I use WebObjects all day at work, but that's a bit heavy duty for small projects of my own, so I set out to find my perfect framework.
I started out looking into some more esoteric options, like Compojure, Lift, and Erlyweb, but quickly dismissed those since I also wanted to learn something that might make me a bit more marketable. I mean, hey, you never know, one day I just might want to start my own consulting company.
Since I wanted something, fun and marketable, I started looking at my favorite mainstream language, namely Ruby. Now, as I may have mentioned before, I've tried Ruby on Rails many, many times. I've owned two different copies of the Pragmatic Programmers Ruby on Rails book, a few screencasts from them as well, and a few from Peepcode, all of which were excellent resources for anyone wishing to learn Rails. Nevertheless, every time I start out with Rails, I'm always impressed with it's power and speed, but it never takes long before I reach a point where I feel like I'm no longer programming in Ruby. The conclusion I've come to is that I absolutely hate magic. Rails is just way too magical for me. It's my belief that, for someone to really enjoy working in Rails, they either have to be both language agnostic (in other words the framework is more important to them than the language) and comfortable with not knowing the inner details of the tools they are using. Unfortunately, I am neither of these as it turns out.
I like Ruby too much to give it up for some DSL'ized version of the language and I can't seem to get anything done in Rails because before I can work with it I have to understand it. That means quite a lot of studying up on how Ruby metaprogramming works as well as many other esoteric parts of the language. That means before I can become productive, I have to digest several hundred pages of explanation of how everything fits together, because just reading the code that I wrote to get a web app up and running is not giving me a damn clue of what's going on under the hood. In my opinion, that's just way too much overhead to get started with a framework whose main purpose is to make you extremely productive from the start.
That's about the time that I decided to switch gears and take a look at a language that I used to really love before I ran into Ruby. I decided to take a second look at what the Python community had in the web framework arena. After looking at several I came to two that I really liked, Pylons and Django. In the end Django won, but that's not to say that Pylons wasn't a close contender, it just seemed that Django was a more polished and refined framework. I got the feeling that many other frameworks were someone's itch that they wanted to scratch, but that Django was a finely crafted tool for someone who wanted to get things done and they wanted to augment the language they loved and not hide it.
So, how do I feel about my decision a month later and half way through the Django book? Well, I think the title of this post speaks for itself. Making the switch back to Python was a great decision, I've really missed it and I think I'll be concentrating on it again quite a bit in the future, and as for Django, well...Django absolutely rocks!
Over the coming weeks, I'll be going into more detail about what it is about Django that just makes me all giddy inside. I'll also be covering some of the blemishes that I've uncovered after spending some time with Django. Finally, I'll be writing up the project that I created for my wife as a way of really getting to know the framework. For anyone interested, I'll be posting the source code when I'm done and I'll be writing up a nice little tutorial that uses the "micro-application" that I wrote for my wife as the example.
Consider this post the introduction to a small series of posts on why I've come to love Django. If you are currently in the market for a new web framework, then this series is aimed squarely at you. I'm hoping that over the coming weeks I can convince some of you fence sitters out there that Django is the framework that you should be getting excited about.