Python is often criticized -- as much from within as without -- for
its proliferation of web frameworks. And yes, there's a
lot -- and the list on that Wiki doesn't even cover them all, or
account for the miniature frameworks built into applications. For
instance, Leonardo and PyPI each have ad hoc frameworks, just to give
two examples.
People suggest different ways of "solving" this problem of diversity,
and say that this is the reason Python isn't as popular for web
programming as PHP or Java or some other language. But I think it's
time we just get over it -- the "problem" can't be solved. Java and
PHP both have lots of frameworks, just like Python; this is simply the
inevitable result of a diverse use base, and there's simply no way to
stifle diversity and reimplementation in an open source community.
Instead of reducing the options, we should work on handling the
situation we have, of enabling a multitude of options instead of just
complaining about it.
What does that mean?
- Installation should be easy.
- Aspects of an environment should be implemented in a
framework-neutral fashion when possible.
- For specific domains, specific "frameworks" (some of which might
not yet exist) can achieve dominance without having to address all
needs.
- Applications made up of pieces using several frameworks should be
possible and workable.
- We develop more agreement on best practices.
- In some areas diversity can be reduced when we've decoupled
specific features and identified the best implementation of those
features.
- Adopting a framework is less commitment, and moving to a different
framework no longer requires anything like a full rewrite.
- Strong decoupling is achieved to significantly increase reusability and
testability.
We don't need some Killer Framework To Rule Them All -- we should work
on an army of frameworks instead of a single Goliath.
The obvious way to do this is with WSGI. So far my experience
with using other people's WSGI-enabled applications (or applying WSGI
changes myself) has been quite successful -- when you follow the spec
things Just Work.
But it shouldn't stop with simple WSGI backends to current frameworks
(even if that's the right place to start). We should start pushing
functionality deeper into the WSGI stack as middleware,
and providing fine-grained WSGI applications that can be usefully
integrated into other applications.
I think Python has a unique opportunity here:
- It's hard to do this in Java because static typing makes loosely
coupled stacks hard to implement. They do have a standard for
interoperability -- the servlet spec -- but there's no agreement on
the extra abstractions they need to deal with typing issues and
achieve real decoupling (with things like IoC containers).
- PHP simply lacks the abstractions necessary. It's not even clear
what "framework" means in PHP -- there are frameworks, but they
are seldom well partitioned entities. Maybe it could be done, but
on a community level they lack the right focus.
- Ruby doesn't have multiple frameworks that anyone cares about.
- Perl is stuck in the past.
- .NET is... well, as a community there's the potential to do this,
but I don't think diversity has bloomed there. Maybe it will, but
the non-MS-oriented .NET community is very young.
Instead of wishing Python web programming was more like language X, we
have the opportunity to do something new. We can turn this perceived
flaw of diversity into a real benefit.
This isn't innovative like a whiz-bang new feature, and it's not new
like proprietary-world new. This is the kind of innovation open
source has been good at; integration, making things work together in
new ways, realizing the benefits of distributed development. This is
real innovation, it's just not innovation that the proprietary world
tends to pay attention to. But working programmers know the value of
this work.
This is what I've been working on in Paste; but an integration framework is only as
good as the number of things that are integrated. I could use more
help; simply using Paste is help. So please, the project needs more
eyes and more diversity. And it matters.