So, you want to write a web application, and you’re looking for a framework?
I bet you don’t. I bet what you are really trying to write is a fancy CMS. “Wait!”, I hear you cry. No, you wait…this is my post.
Let me explain what I mean by CMS (Content Management System): it’s a system that is involved in moving some content from some users to others, where “anonymous” is also considered a user. Often, the ability to integrate mail (being able to send mail in and most importantly to get mail notifications) is also considered a part of CMS.
Where does that leave us? Facebook: a CMS. Twitter: a CMS. Livejournal: a CMS. Gmail: a CMS. Google Search? Nope, that’s not a CMS: that’s an actual web application. It gets input, it runs some code, it shows output.
Ever wondered why ORM is so popular in “web applications”? Because when you’re primarily moving content about, describing that content is a really important part of the equation.
CMSs are basically about communication. This is why they are so popular: people enjoy to communicate. A lot. (Hey, people reading my blog!)
That’s fine. If you wanna write a CMS, go ahead. Use Django, or RoR or whatever. I bet some of these are better than others — but because I have no experience with CMSs, I cannot give good advice on that topic.
If, however, you want to write an actual web application, not a fancy CMS, what will you use? Certainly not Django or RoR. That helps you very little. Yes, it’s got “a request object” (that wraps around 3 WSGI objects/methods). It’s got a “dispatcher” (how long would it take you to write something that maps URLs to code? 5 minutes). And it’s got a templating system.
But here is the point — I don’t know if Django’s templating system is any better than any other. I’m not a fan, of course — I would use Nevow’s template, or perhaps ZPT. But templating is really about choosing a language, so arguments tend to be almost purely emotional here.
So what’s an example of a web application? Well, let’s enter my mind for a minute, and see what we find. These days, I’m involved with AppSpeed, an application-level performance monitoring system. It’s an application that helps you monitor your performance. But it’s not out yet, so let’s look at other things in roughly the same category: managing your wireless router. It’s about the same general niche — data center management. Except this is about the tiny data center you have in your house.
The requirements for both are the same — we want to use the web application to *understand* and *control* what’s going on in the infrastructure. There’s no ORM: if you’re keeping data, be it configuration, logs or history, you already have that choice before you started writing the web part.
So, given that dispatch is trivial, and the ORM is irrelevant, you need to choose two things: a templating system, and a JavaScript framework if you will use any AJAX at all. Templating systems are a dime a dozen, and JavaScript frameworks are likewise — and any combination works more-or-less as well as any other.
So, what’s my point? Web application frameworks are really CMS application frameworks. If you want to write a CMS, go ahead — it might get popular and worth billions of dollars.
But if you write a web UI for a non-CMS applications, just choose a random templating system, and enjoy…as long as you remember that any commonly-known wisdom about web application has a good chance of not applying to you.