Python v PHP: fair comparison?

tobiah st at tobiah.org
Wed Nov 15 14:28:04 EST 2006


I've wrestled with this for quite a while, and I think
that I've come up with a solution.  Let the heavy lifting
of the application be done with a back end python process.
I was thinking that I might use cherrypy to sit there and
wait for requests.

Then, I would have PHP make calls to this back end process
to get the content that it needs.  This could be on any level
from a simple datum from the database, or as complex as
the HTML for the entire web page.  I'm still trying to settle
on a protocol (SOAP, CORBA?) but I think that it should be
at the object level rather than simple posts to cherrypy.

Anyway, even though not all web hosters have a reasonable
python web framework installed, they will almost certainly
allow you to run python programs.  The PHP might eventually
boil down to simple function calls that get content from
the back end.  Let python do all the work:

<?php

	put_attendee_mailing_info($id);
	list_cart_items($id);

?>


walterbyrd wrote:
> I don't know if this is a fair comparison or not. Any comments
> appreciated.
> 
> - Python is more readable, and more general purpose
> - PHP has awful backward compatibility
> - PHP has a lower barrier to entry
> - Most inexpensive web-hosters support PHP, but not Python
> - PHP has far more pre-writen scripts available
> - Newer versions of mod_python require Apache 2.0, which few hosters
> have
> - There is more demand for PHP developers, than Python developers
> 

-- 
Posted via a free Usenet account from http://www.teranews.com




More information about the Python-list mailing list