Python Needs a Corporate Angel

Okay, some more opinions from me about Python. I decided not go with it for various reasons, but in general it boils down to the quality of the app servers out there and the varying quality of documentation and projects.

This is not an indictment of Python as a whole. I discovered that it's as cool as I thought it was. It's crufty in some ways, but the important thing is that the Python community knows *exactly* where it's crufty, has documented it all and gone on with their lives. They get a little pissy being constantly questioned about those parts by newbies like myself, but in general the community is pretty cool and the power of Python easily makes up for any drawbacks.

However, here's the problem. Using Python when compared to Java is like using Linux when compared to Windows. Yes there's incredible benefits from the open source alternative, and great communities to support them, but there's an incredible variation when it comes to standards, documentation and quality of code. I know I ranted about the pressure of doing things the "right way" when it comes to Java recently, but I just didn't realize how much of a wild west development in Python is. When you're developing with Java you have the advantage of a corporate backed platform with a zillion books, articles, and a ton of official documentation about how *everything* works. There are few questions. Java is verbose and the corporate influence means that a bunch of corporate geeks love to find the most elaborate way to do anything in code before then declaring it the gospel (EJBs anyone?), but still... If I need to go to an IRC channel or search through mailing lists or newsgroups to find solutions to simple problems, I get annoyed. You might remember that Cocoon was the same exact way for me.

The thing that most disappointed me about Python is the lack of a standard web application server implementation. I looked at several different options and decided against going with all of them. The first was Webware. It's a really great clone of how a J2EE server works, but in Python. It has Python servlets, PSP pages, etc. It's very close to being like a Tomcat for Python. You can even plug in another project called Cheetah which works just like Velocity (I'm not sure which came first) for templating. You need to use Apache in front of Webware because it's not its own web server, but that's fine - it comes with an incredibly easy to install module for Apache which works quite well. If I got it set up, then you know it's pretty easy. However, once I got the basics working I was at a loss to figure out how to implement MVC! There doesn't seem to be any way for a servlet or PSP page to forward a request to another servlet or PSP page!! I'm not talking about a redirect, I'm talking about a server-side forward.

Ready? Here's the thing - there *might* be a way of doing it, but the documentation is really sketchy. That to me was a deal breaker.

The other ways I tried were mod_python and JonPy tools (which help with simple stuff like session management and db pooling) but just about *everyone* said "DON'T USE MOD_PYTHON!", I'm not even sure why, but I took them at their word. Besides, doing develpment that way would have been very low level and I wanted a bit more support than that. The third way I tried was Twisted - which I was really into for about a half hour. Once I grokked that I needed to do all the settings stuff in a Python file then call the demon and pass that settings file to it to run, I quickly set up an http server with virtual sites that ran .rpy python scripts instantly! Cool! Except then I was ready to get into doing a DB call and I learned that Twisted is *single threaded*. What?!? You've GOT to be kidding me. If you want to do any sort of outside call, it's implemented as a callback. The code for a simple DB call was huge and not at all Pythonic. I'm sure Twisted is a wonderful project with a lot of advantages, but that was the deal breaker right there. Finally, I also checked out Draco and Aquarium and decided against those as well. (Call me picky).

So in my humble opinion, it would be great if a corporate entity - bigger and more influential than Zope - started pushing Python a bit more. Documentation, standards, application server reference implementations, etc. In other words, a bit more like Java. There's got to be a middle ground between tight corporate control and open source free-for-all. Corporate sponsership (say by IBM or even Intel or some company of that stature) would also give a boost to its use throughout the rest of the corporate world and maybe give a boost to the numbers of jobs looking for Python skills. The Python people who are happy with the status quo will probably think I'm nuts, and that's fine. I'm writing this for the teeming hoards of Java programmers looking around for something a bit funner (and more productive) to use who are going to run smack into the same issues I've run into.

Here's some advice for the Java guys moving over: The language is cool, but there's a lot of other supporting issues that you have to deal with. Where you can "live" in Java for the most part, Python will regularly drop down to the underlying platform. (Remember why you moved to Java in the first place?) It's mostly cross platform, but there's various libraries in the standard install that work only on Unix or only on Windows. When installing on Windows, many libraries come as .exes. There's no concept of .jars in Python, so when installing extensions, the actual .py files are copied into the C:\python\Lib\site-packages directory. There's also seems to be a dearth of specs - even database access doesn't seem to be particularly standard (like JDBC). And once you get outside the core libraries on, you can expect that anything goes in terms of code quality and documentation.

To the rabid Pythonistas who will assuredly jump down my throat on this... please educate me if I'm wrong and I'll post corrections, promise. These are just my thoughts after a couple weeks of learning Python.

One example where I was wrong before was that I slammed Jython as a half-ass Python implementation. Which is what it sort of looks like being 2 versions behind the current CPython specs. However, it's *not at all* half-ass, it's actually quite brilliant. This is just speculation, but I think that in the late 90s when Jython was being developed, Java was at the height of the hype curve and I think at one point there may have been a thought that Jython could be the successor to Python. A *lot* of work went into making Jython a really good Python implementation *and* the Python community even brought Jython into the fold, promoting it to basically even level with the original project. In books and articles now, you read about CPython and Jython as if they were equals, its quite interesting.

Jython needs help, however. Guido even petitioned help at the last Python event. It seems that there's a lot of users and not a lot of developers and now Jython is a few years behind where Python is on the development curve. Another problem with Jython besides it's libraries is that the code runs up to 10 times slower than its CPython and Java counter parts, yet I'm sure that there are ton of real heads out there that could improve that with optimization of the libraries... Personally I was disappointed that I couldn't just grab Mark's file and run it in Jython. It'd be so nice to use that bit of code on my current project. Anyways, Jython is actually insanely cool, and I hope someone gets heads down on it soon so that it doesn't get farther behind.

That's all about this. I'm back in my comfy, yet frustratingly verbose Java world for now.


< Previous         Next >