What's wrong with CGI: slower, uses more memory, probably more likely to be misprogrammed and insecure. Puts more of a strain on the host computer than Java or Javascript does (of course the compiled server modules share that problem).
There are a lot of things right about CGI, especially portability if you program CGIs in perl (python less so). The problem is that web and net technology are expanding faster than many of us can keep up with, both at the client and server end. If you want to be a web guru now you should also have more than a passing familiarity with XML, SOAP, etc. [I recommend
http://www.apple.com/applescript/macosx/script_menu/], and with the CSSes. Since you're already into Python, why not check out Zope?
Originally posted by Valrus
I've just started doing some CGI programming and I rather like it. I do it in Python, not Perl, though, and it's phenomenally easy. So what's the difference between PHP and CGI? What can you do with PHP that's so great? I don't mean to be aggressive. I'm actually curious about PHP and might want to do some myself if it seems useful.
-The Valrus
Here's my take:
PHP 4 is probably faster overall than perl-mod and definitely than python-mod when running with an Apache server. For this reason, and because PHP seems to be easier to use for most people, I think the odds that your ISP or employer or whatever will have PHP are greater than having perl-mod or python-mod. PHP can be compiled to run as a CGI too. The reason people use php-mod and perl-mod vs. using perl or PHP or python or VB CGIs is that the latter use more memory and are slower.
There are other possibilities for a server - server-side javascript or python-mod for example. Moreover you might be running something like Netscape server or NT server. You might be running the server from Zope (a python-derived package). You might even have only active server page capacity instead of php. If I were only writing php for my own use or for something that I ran, I would use .asp-like tags, so that if I have to try writing some ASP code at least it won't feel so alien.
If you program in a structured way, particularly in an object-oriented way, a lot of that won't matter.
For example, I might have essentially the same website one place using php and mysql, and on another, which doesn't seem to have any mods, I would use javascript to include files, and a perl module called Sprite to manipulate csv data files.
In both cases I would use structures and functions to do the same things, access data, include files, do updates. Only the guts of the components would change, not the output, or, much, the names of the functions, structures, databases, etc.