[Tutor] Python vs. PHP
alan.gauld@bt.com
alan.gauld@bt.com
Sun, 27 Jan 2002 19:45:41 -0000
> Looking around, I find what seem like two different kinds of dynamic
> webpages. Some are written in Perl (Slashcode) or Python
> ...ASP/PHP. I guess the former are CGI scripts, and the
> latter are active server pages.
There are a couple of other types as well of which the best
known is JSP or Jasva servlets. But for the sake of
convenience I'll refer to the two types as CGI and ASP
They all use the CGI interface but execute slightly
differently.
> What are the relative merits of doing things
> one way or the other?
Big religious arguments over this.
In traditional CGI the cost of starting a new process
for each request is a big performance hit - especially
on Windows. So ASP was developed coz ASP runs inside the
Web server engine and avoids the big startup cost.
However CGI hit back with CGI launchers embedded in the
server, thus mod-perl and mod-python came to be and
virtually wiped out the startup issue.
So now it comes down to whether embedding code inside
html(ASP) was better or worse than embedding html in
code(CGI). Now .NET is taking ASP one step further and
totally separating the code and HTML(apart from some
linking statements)...
Personally I use ASP when I have a largely statioc
HTML web page but want a bit of dynamic content. For
example a date/time display or web counter.
If the bulk of the page will be generated dynamically
- like an Amazon book description say - then I use CGI.
Finally, I'm sure somebody else will tell you about Zope...
Alan G.
(Still stuck in the snow :-)