[Chicago] Web Frameworks?

Kumar McMillan kumar.mcmillan at gmail.com
Fri Aug 17 22:13:49 CEST 2007


On 8/17/07, Massimo Di Pierro <mdipierro at cti.depaul.edu> wrote:
> I could write my own "perfect" web framework but that is not my
> point. Too much choice is killing python web frameworks because the
> work of many good people is scattered and not focused.

My take on the state of python (and most dynamic languages) these days
is that it's *easy* to reinvent the wheel and often times it's a good
idea.  It can be faster and easier to maintain since it's isolated.
The django framework has almost completely reinvented the wheel, thus
it's easier to deploy.  I also think Ian hit the nail on the head with
a blog post a while back (can't find it) that talked about how copying
and rewriting code is not as bad as you think.  Dependencies and
linking to libraries kind of sucks.

I'd suggest forgetting about finding that silver bullet framework --
you won't be able to teach your students how to use a framework that
will keep them gainfully employed as an expert of that tool.  They
will need to know "how to program" to be gainfully employed as a
programmer.  That means  knowing more than just python, more than C,
knowing architecture, testing, troubleshooting, etc on a conceptual
level.

If you have an advanced class, why not make them write a framework?
In fact, why not have them write 4 frameworks, each built by a team of
2 or 3.  They will learn more about the web, python, http then they
ever will by using a framework already built.  Just be sure they don't
get hyped up enough to release one publicly ;)


> 1) Keep in mind that too much choice is bad, not good
> 2) Do not reinvent the wheel
> 3) Keep the API stable, work on improving implementation and documentation
> 4) Have one person in change of usability and one in charge of security
> 5) Focus on a single framework (I suggest Pylons + Genshi + WebHelpers +
> Django or Canonical ORM) that works with mod_python, defaults to SQLlite and
> has sessions on by default. You already have all the pieces... just put
> package them well.
> 6) Make sure the ORM works with Oracle
> 7) Write API for Generic View, Login/Logout and Registration
> 8) Write documentation...
> 9) Write documentation...
> 10) Write documentation...

This is mostly a good list -- documentation, for one, has been the key
to Django's continued success.

But as Ian says, where is "testing" on this list??!  If I were to
complain about one thing in my experience of trying to hire competent
developers straight out of school it would be that they have no idea
how to test code.  I've never even heard first hand of anyone learning
unit testing from a CS program, although I don't doubt it's taught
somewhere (Titus Brown must teach it).  To our company, code without
tests is worth nothing.  We would rather throw it away than have to
maintain it.

> ...We teach students that they should use XML for nearly all web data
> exchange therefore Kid is perfect.

XML is great for data exchange from computer to computer, but that's
about it.  I think XML generated by hand, maintained by hand is
complicated, error-prone and tedious.  However, this would be a great
learning experience for students, especially since xpath is invaluable
(you could teach a class just on xpath).  Teaching hand-coded XML
would be akin to writing a framework from scratch - a great learning
device but not a practical coding strategy.


Kumar


More information about the Chicago mailing list