[CLUG-tech] AJAX - PHP or Python long term?

Greg Armer wiqd at codelounge.org
Sun Dec 9 10:06:48 SAST 2007


On 12/8/07, Wayne Koorts <wayne at wkoorts.com> wrote:
> Hi all,
>

Hi Wayne,

> I'm looking to get into some AJAX stuff for the web.  My "main" language
> is Python and I'm incredibly happy with it for everything I've been
> doing so far (traditional offline desktop-type apps).  I know that
> Python can be used for AJAX / Web 2.0 etc. (and I don't want to get into
> the definitions) but PHP is obviously where the market is largest in
> terms of how many people are using it for web development vs. Python.
>

Personally I think you are on the right track already with your
concerns to come to the conclusion I am about to suggest. I have had
the experience of doing the server side logic for my AJAX apps in both
Python and PHP (and even once with a simple perl CGI script) and have
found it to be the quickest and easiest in Python.

> My question is:  Thinking long-term benefits, not what the market is
> doing, technically and so on, which would be the better language to go
> for in terms of web development?  I'm asking independently of any
> specific frameworks (Django, Turbogears et al).  I just really need to
> know which one is going to be more worth my time investing in.
> Obviously there are generic parts to both in the AJAX equasion; CSS,
> XHTML, Javascript etc. but I'm specifically asking about the server side
> scripting language.
>
> All opinions appreciated.
>

The biggest problem you will encounter is, will the people who work on
this after you have the skill and experience in using python, there
are a lot more PHP web developers to each Python web developer out
there, so your choice of server side language should be guided by
maintainability further on down the development time line. Will anyone
working on your project after you have the python knowledge and
experience or be willing to learn it.

Doing AJAX with PHP handling the logic is fine, you will have many
other people who can work on your project after you (many more than if
it were written in python).

As a total personal opinion, I love python and would recommend it for
anything web related. At the same time AJAX is purely a javascript
concept and there are some really nice JS frameworks out there that
can do _almost_ everything a server side language can do including a
persistence layer (see Amazons S3). This is of course not my
recommendation but it is possible. Also I lean more towards JSON
instead of XML for data interchange as it feels a lot more "pythonic"
and I can often get away with running a str() on a list or dict and
using that output directly in JSON.

Hope that helps.

--
Greg Armer


More information about the clug-tech mailing list