whateverblog.
Getting started with Python
Thursday, May 22, 2003 11:40 PM

Started playing with Python a little bit tonight. After hearing so much about it on Artima and various weblogs, I thought it was finally time to see what all the fuss is about.

So far I've only gotten around to writing a couple of toy procedures, but I am already starting to have an appreciation for how easy and natural the language syntax is. As it says somewhere in the docs, Python looks a lot like pseudocode. I actually like the significant-indent style; I never noticed how ugly curly braces were, until now. Also, the interactive shell is fun--I think Python may be worth learning just so I can interactively test my Java classes using Jython.

I want to spend a lot more time with the language before coming to any solid conclusions, but I couldn't help thinking about whether I was going to be able to get over the lack of static type checking. I think there are a lot of programs, even large ones, that really aren't going to benefit that much from static type checking, but many others where you really want to have it.

Software projects with sprawling "palaces of abstraction", especially where said abstractions are constantly in flux, certainly benefit from static type checking. Most of the companies I've worked for in the past three years have had mostly this kind of situation; a B2B bond trading marketplace, an online/offline consumer rewards program with hundreds of nationwide retail partners, and now--well, I can't talk about my current job, but the subsystem I'm writing definitely fits into that category. All of these codebases had hundreds or thousands of classes, featuring deep class hierarchies and heavy use of interfaces. All were constantly being debugged, tweaked, refactored, gutted, rewritten, and rethought by swaggering young coffee-chugging developers. It's hard for me to imagine maintaining that kind of code without a type-checking compiler to keep things on the straight and narrow.

On the other hand, many of the projects I worked on more than three years ago seem like they would have benefited from Python. I would have been quite comfortable implementing small- to medium-sized content management systems, or community websites like the Action XChange, in Python. The new photo album webapp I recently lauched probably would have been finished faster and with less code. These are situations where, for me, it's hard to imagine needing palaces of abstraction.

Anyway, I'm looking forward to exploring Python further and seeing what all the hype is about. It's hard to imagine any language living up to the kind of praise some programmers have been lavishing on this language, but I'll give it the benefit of the doubt...