PHP and Python hit prime time

It's strange to say that PHP (Hypertext Preprocessor) has only recently reached the point where it's ready for prime time, since PHP is already the most popular Apache module, running on almost 10 million domains (over a million IP addresses).

Python vs. PHP: Choosing your next project's language

Nevertheless, I've had some reservations about PHP until recently, especially with respect to potential security holes. Then I downloaded and installed the latest version of FUDforum, an open-source PHP-based Web discussion forum package I use for my nonprofit Web site, VarLinux.org. You can get an idea of what FUDforum looks like by visiting www.varlinux.org/forum. But what you should really examine is the PHP code behind FUDforum, which you can download from http://fud.prohost.org.

At some point when I wasn't looking, PHP matured to a point where one could easily avoid the security holes that plagued some old PHP programs. This is especially true if you take an object-oriented approach to building your PHP applications.

Another good example of high-quality PHP programming is phpWebSite (http://phpwebsite.appstate.edu), a Web content management system with several good snap-in expansion modules, including one that lets you create e-mail accounts for CommuniGate Pro, an increasingly popular drop-in replacement for Microsoft Exchange. The CommuniGate Pro e-mail and groupware server (www.stalker.com) has a built-in Web interface for e-mail that you can integrate into the site you manage with phpWebSite.

The only thing I haven't yet seen done well in PHP is an open-source Web-based groupware application. Yahoo did a pretty good job designing its Web-based calendar (http://calendar. yahoo.com). It even allows you to synchronize your data with a Palm device. But most IT departments are going to want to host their own calendars and groupware, and if there's anything that's been done in PHP that is of comparable quality to what Yahoo came up with, I haven't found it. There is at least one decent commercial offering, Internal Affairs (www.internalaffairs.de/en/), and several open-source projects are in the works, a promising one being PHProjekt (www.phprojekt.com). But none of the ones I've tried exploit the maximum potential of the PHP platform.

Love That Python

Of course, there's more to life than PHP. One of my favorite programming languages is Python (www.python.org). It seems I don't go a week these days without someone asking me what I know about Python, so it seems to be gaining quite a following in mainstream IT.

Admittedly, Python is a love-it-or-hate-it language, but those who love it claim to be far more productive than with any other language. Being on the love-it end of the spectrum, I'd argue that it's a well-founded claim.

But Python hasn't gotten much past the promising stage for Web applications development. Until recently, Webware has been the best choice for Python programmers (http://webware.sourceforge.net/). Webware is very nicely done, but its one weakness is that you need to run a Python-based application server in parallel to your Web server. In contrast, PHP integrates directly into the Apache Web server through a plug-in module.

There's nothing inherently wrong with the Webware approach, but it is difficult to tell how much overhead Webware will add to your applications. Webware simply hasn't been around the block as many times as comparable Java-based application servers.

Spyce is a newcomer to the Python Web applications approach, and it may not only push Webware off the map, it could also eventually give PHP a run for its money (http://spyce.sourceforge.net). Spyce lets you embed Python code into your HTML in basically the same way you would if you used Webware and Python Server Pages. But Spyce doesn't need a separate application server to work. Spyce piggybacks off the Python or fast-CGI modules available for Apache.

I haven't done much more than a few minor exercises with Spyce, but so far I'm extremely impressed. The library of Web features for session management, cookies, forms, pooled variables and other Web applications goodies makes it surprisingly easy to toss together a prototype to see if it's worth using for your next project. If you even have a passing interest in Python, I recommend that you give Spyce a look.

Join the newsletter!

Error: Please check your email address.

More about ApacheCGIHewlett-Packard AustraliaHPLinuxMicrosoftPalmVarLinux.orgYahoo

Show Comments

Market Place