So Reddit has moved to Python from Common Lisp, and
to a previously unknown (still unreleased) framework webpy (but also with the well-known SQLObject and Cheetah),
causing some minor controversy.
One thing that comes up often in these discussions is a dismissiveness
towards something you feel you can reimplement yourself. This
actually appears in a whole set of cases here -- reddit reimplementing
their site, webpy implementing another framework, the Lispers
impression that they could reimplement any Python library if it was so
important (or that they could just reimplement reddit entirely), and
so forth. Sometimes reimplementation works; but often you don't
realize the true scope of what is implemented so far, or you ignore
the opportunity cost (you are coding to produce no advances, instead
moving forward), or you ignore the fact that the thing you are
reimplementing may itself be advancing even as you reimplement it. I
don't have any new thoughts on this, really, but it's interesting to
see so many kinds of reimplementation in the same discussion.
Anyway, Aaron Swartz talks about the
switch as well, and about why he chose (or stuck with) webpy instead
of Django. One thing he doesn't explicitly say, which I think is an
important criteria, is that Django's best features (its CMS-ish
features) probably have no relevance to either reddit or Aaron's
project. So Django's features are just baggage in that context. In
particular, they are both working on just one application; they don't
need to push out lots of apps, they probably aren't working with many
(any?) designers, and they want to optimize some very specific aspects
of their application that they consider the competitive parts.
Another aspect is that they probably don't mind a little legwork to
implement each form, if it means they can tweak that form arbitrarily.
Since I believe exceptional UI is only possible if you diverge from
the rules, I'd agree with them. Good UI doesn't necessarily require
that, and when you are looking for quantity instead of quality, a
framework can be very useful. Better the rule-driven good form a
framework gives, then the crappy form you write yourself which you
don't have time to improve.
Another thing that complicates Django -- and many other frameworks --
is configuration. When Aaron mentions that you have to use their
console and environment, it's because of configuration. I personally
haven't figured out the right way to do configuration. I suspect the
webpy answer to that is to hardcode many things, or use ad hoc
techniques to identify your environment. That works when you are
maintaining one app in a small number of environments. But even if it
isn't important for them, configuration is important for most people;
if all webpy does is avoid the issue I think they've oversimplified
the system.
Aaron also says that he doesn't think there's any framework that
matches the simplicity of webpy. Well, I'll bite and offer up
Wareweb. Since I've finally
gotten a chance to use it some more, though only on small apps, I'm
feeling a little more confident about it. I still might remove some
parts and add some parts -- I've been thinking about REST-like
dispatching (but definitely not as strict as webpy seems to be), and
I think the generalized event system in Wareweb isn't really necessary. The URL
dispatching webpy uses could be applied easily enough. But enough
apologies, those suck. Wareweb is:
- Really simple.
- Extensible (extension is required if you want to integrate with a particular templating language, but it shouldn't be hard).
- Flat with respect to WSGI, which means...
- Easy to integrate with code that Doesn't Fit Into Frameworks.
- Environment neutral; you can embed it anywhere.
So if you find yourself looking for a simple web framework, I would definitely
suggest looking at Wareweb.