How do we keep an ecosystem of frameworks useful to newcomers?

The first day of Pycon 2005 is wrapping up, and we’re heading to dinner soon. Attending the sprints was a good way to get ramped up before the talks; I think if I hadn’t been breathing Python 24/7 for a few days first, I might not have been able to follow anything.

I won’t comment on everything at once, but of the three web talks I attended, one piqued my interest (WSGI), one was really cool (Donovan’s LivePage/LiveTest/Canvas demonstration), and one struck a chord. Michelle Levesque put together an ongoing project called PyWebOff, comparing major Python web application frameworks from a user’s point of view.

She started off with a very good point: that Googling Python web application framework brings up a laundry list of different frameworks, each with different capabilities, features, strengths and weaknesses, levels of documentation, and sets of assumptions about the average user’s capabilities. To contrast, Googling for Ruby web application framework comes up with one application, Ruby on Rails, which will do nearly everything you want in an elegantly simple way (though not in Python).

So what can we do about web application frameworks? The archetypical beginner, who loves Python for its ease of use but has only ever used PHP (or ASP, or ColdFusion, or CGI) for creating web sites, will probably give up fairly quickly if they get started in the wrong place. Michelle’s assertion that a plethora of choices is confusing is valid, but I question her conclusions. Her talk closed with the argument that we need to slim down the number of Python web frameworks and settle on three “major” frameworks: one for “large” applications, one for “medium” applications, and one for “small” applications. (She also made a plea for nobody to release another web application framework after her talk, which may have some impact, but probably not as much as we’d like.)

It is tempting to cut across the vast number of existing web frameworks and toolkits and broadly classify them. A meme I hear from many people is that they can be divided into “big”, “medium”, and “small”; another is that frameworks are “process-driven”, “thread-based”, and “event-driven”. These are properties, yes, but they are not the only properties which web application developers need to consider.

I think we need a User’s Guide to Python Web Application Frameworks (or something with a slightly better name), to help newbies to Python web programming make sense of the myriad choices available to them. It wouldn’t need to get into the itchy details, but it would need to explain why there are so many frameworks available. Most times that someone reinvented the “web framework” wheel, it’s because they made a conscious design decision to do something differently.

When someone says, I don’t care about the details, I just want to write a web page, that’s a valid position only to a certain degree. Unless you plan on writing plain CGI, you can’t expect to start writing web applications without understanding some of the basic concepts behind these frameworks; you don’t need to know details, but you do need to know why people keep deciding to reinvent the wheel. Choice is good; uninformed choice is dangerous.

I won’t delve into why I think Twisted Web and Nevow are great tools for building web applications, and why I think these tools are much better than tools like CherryPy (even for small applications). That’s personal preference, and I think the Python web application community needs to learn to put personal preferences aside and help newcomers to make their own choices. Otherwise, their choice may very well be Rails.

No comments yet.

Leave a Reply