Python vs PHP for our rewrite?

Ian Bicking ianb at colorstudy.com
Sat May 17 05:59:43 EDT 2003


On Fri, 2003-05-16 at 14:40, Jay O'Connor wrote:
> I'm working on an web application tghath the boss wants to get off the
> current language implementation (Smalltalk) and go with..something else.
> 
> He favors PHP but I'm lobbying hard for Python.
> 
> PHP is attractive from a business side but I looking at some technical
> issues.  One thing the boss told me that he was told was 
> 
> 
> "Definately go with PHP though if you want to have it available to the most
> number of people possible, a lot of hosting companies don't have python, 
> or don't allow it's use because it takes it longer to execute and tends to
> be more CPU instensive than PHP does (in fact the hosting company I do
>  work for disallows it except in certain specific cases for that very reason)"

Yes, he's got a point.  Python isn't efficient as a CGI program and
installing a persistent server isn't something that is widely supported
(but a persistent server is fast, of course).

The result is that Python web serving probably looks a more like
Smalltalk than PHP, though probably slightly better as there are some
select hosting companies that specialize in Python hosting for a
reasonable price, and I suspect (for no reason ;) that Smalltalk hosting
is pretty expensive.  Of course, sometimes you can get by under the
radar of the provider, but that's a precarious situation.

PHP's installation and basic management is way better than Python's.  In
every other way PHP is an inferior language and environment, but that
one thing is unfortunately pretty important.


Well, some would say that CGI Python isn't so bad.  See the Slither
framework for an argument on that.  If you structure your system right
you can get away with it, but you'll have to limit the depth of your
abstractions, and optimize for startup time.  I think most hosts will
support Python, though -- it's widely installed these days, and most
hosts don't micromanage scripts to that degree.  I don't think it should
be any worse performing than Perl CGI when done carefully (using a
stripped down search path, for instance, or the mx CGI interpreter).

So, it's a compromise in architecture to use CGI, but that's a hell of a
lot better compromise than using PHP.  Especially if you are coming from
Smalltalk.

  Ian







More information about the Python-list mailing list