Thursday, March 16, 2006

A hypothesis on why Pythonistas reinvent wheels

Well, maybe the title's more inflammatory than need be. This post is kind of a follow-up to Three Reasons You Shouldn't Write Your Own Web Framework, but it's a little broader than that.

My hypothesis is that Python has two "things" that appear together in few (if any!) other languages right now, and that the combination of these ingredients makes the proliferation of web frameworks (and libraries, and RSS readers, and wikis, etc....) nearly unavoidable.

Python has power



First off, Python is a powerful, expressive language. Sure, the Lispers out there deride its lack of macros, Rubyists bemoan its "impure OO", and so on. But Python is expressive enough. Enough to lower the amount of pain it inflicts upon programmers to where some would rather build a framework/library that's just right instead of grabbing something else that's out there. It's just so stinkin' easy to code up something quickly that will do exactly what you want. (Well, almost what you want, and you know how to avoid those bugs, anyway. ;-) )

But there are other languages that are more expressive, concise, "powerful." Why have they, too, not embarked upon the path of infinite diversity?

Python has programmers



Python is one of the most widely-used dynamic languages in the world today. Yes, Perl is more widely used. [Edit 4/1/07: In my completely uninformed opinion as someone who has never used Perl for anything even remotely serious,] Perl also makes it very easy to get yourself in trouble very quickly when building a large system. Not that it can't be done. Just that it kind of fails the "powerful" criterion above. Ruby is "getting there," or it may already have surpassed Python's popularity (hard to know for sure with such scientific measurements as "# of Google search results", "# of new books", "# of SourceForge/FreshMeat projects", etc. But Ruby has not had the time to develop the same critical mass of programmers with a hankering to build their own framework. Haskell, ML, Smalltalk, and so forth just don't have the base, either. Lispers built quite a few frameworks/libraries back in the day, but these were mainly in the realm of AI, so we won't hear much about them until AI comes back in vogue.

What to do?



I can't say I really know. After seeing Ian's tutorial on building your own WSGI framework, I see the allure. Working in academia, I also feel the urge to build upon prior research. Maybe it's the nature of the beast (having a widely-used, expressive language). What do you think?

4 comments:

  1. Anonymous10:45 AM

    Something that's worth mentioning is a character trait of most of the Python programmers that I've had any interaction with. Most of them (us) are picky and have arrived at using Python because of a feeling that every other language just sucks too badly to use. Maybe discriminating is a more positive word to label that particular trait with. Anyway, good post!

    ReplyDelete
  2. Anonymous2:44 PM

    You said:
    Perl also makes it very easy to get yourself in trouble very quickly when building a large system. Not that it can't be done. Just that it kind of fails the "powerful" criterion above.

    I regard that sentence as with a big, implicit IMO in front of it, because otherwise it would be FUD ;)

    .phaylon

    ReplyDelete
  3. Anonymous6:13 PM

    @phaylon, I read it with an implicit WTF in front, because I certainly don't see how Perl fails the powerful criterion.

    ReplyDelete
  4. @Perl people:

    You might be right. I was mainly parroting what I heard from others with more experience. I probably shouldn't make sweeping generalizations like that. In lieu of writing the article better last year, please accept my apologies and I'll put an "in my uninformed opinion" caveat in the original article. ;-)

    ReplyDelete