Tuesday, October 07, 2003
python is a time bomb (in a good way)

Python is a time bomb. Or perhaps, it's a time-release mind bomb. I love watching people get it. Lately I've been trading email with a friend who has been bitten by the Python bug.

He's known about Python for a while, and he's a smart guy. I just knew that if I waited long enough, that he'd start to see the things that I see. That having a programming environment that helps you get things done, rather than having you struggle with the mundane is a good thing.

A while back, I made the observation that it seemed that to be taken seriously as a language, it has to do as little as possible for you. I think that was an attitude that hearkens back to the days of computers that measured their clock speed in the low 10's of megahertz. Back when every cycle counted, you didn't want the computer doing anything that you didn't know about when you wrote a program, so languages like C were highly prized, because you got the advantages of a high level language (better control structures, et cetera) along with the control inherent in a low level language.

Nowadays, it becomes harder to see a language like C as being high level. Mid level at best, I would say, these days. Now, if a language can do things for me, I'm all for it. Manage my memory for me. Do all those various string manipulations for me. Help me with error processing. I don't need to write another hashing routine or another link list. I've proved I know how to do that already, and I'm more interested in debugging the bigger problem rather than finding out that I screwed up some tiny special case in my list management.

Python is a time bomb. I've yet to see someone run with it the first time they are exposed to it. We all know the drill. "Indenting for block structure?" "Why should I use Python when I can do all that in Perl?" and the ever popular "Scripting languages are not for serious programs."

But then, because you're curious, you start using it. The first thing you notice is that (if you had good formatting habits to begin with) the indenting issue goes away. You were going to do it that way anyway, right? Then you notice that you got the job done in less time than you realized it would take. Personally, that's my favorite bit. The "It's done already? And it works?" feeling. I love it.

You find yourself prototyping ideas in Python. We've all experienced the "executable pseudocode" bit as well. That rough sketch of code you wrote on a napkin? Chances are it's going to work as it is, or with only minor modifications. You didn't really mean to write it in Python, you say, it just happened.

The Perl issue is handled when you go back to those Python programs after a few months. Even the first ones you wrote, before you had a feel for the way the language wants to be used, even those first steps, are readable. You can still tell what you meant to do with them. Maybe it's just me and my friends, but going back to old Perl code, unless it was incredibly well documented, makes you wish for a cuniform dictionary. (It's 10pm, do you know what context you are in?)

The final domino to fall, the "serious application" domino, is easy enough. We've already heard the litany. Google. Zope. Twisted. The list grows longer each day.

Welcome to Python, Cameron. The water's fine.

9:35:49 AM    comments ()  trackback []  

note to self

look into mod_pubsub.

9:38:37 AM    comments ()  trackback []