I'm looking for script formats that would be highly supported by most web hosts, and therefore would be ideal for the average web site. Nothing that's going to require anything too fancy/proprietary/top end.
I think, we'd be main considering
1) PERL
2) PHP
3) ASP
4) SSI
Did I miss any MAJOR, mostly universally available server side scripting language that the "average" site might use? Of course, there's also JAVA and XML (which I think tend to be used by more serious corporates, with larger database needs).
You may have suggestions on which languages we should add.
Ideally, I'd like feedback from people who know all/most of these quite well, as opposed to users who only know their "favorite" language, and hence will always recommend it.
I'll make a start, and you can fill me in / correct me as need be.
From what I can understand:
PERL
Strengths:
Super powerful. Ideal for processing pretty much anything, and is superior to virtually anything else when it comes to text parsing (read: string matching, regular expressions).
Best Used:
Best used for pages where at least a significant part of the returned page is non static, and where computations, string processing etc are needed.
Weaknesses:
Sometimes takes a couple of extra steps to perform web specific tasks when compared to PHP.
Speed:Set up time is relatively slow (except with mod_perl), but very quick to execute.
PHP
Strengths:
Ideally suited for "web type" processing: sending emails, handling forms etc.
Best Used:
Because it is embeded in an html file, it can be easily used to dynamically generate one or two fields on a basically static page, and where form processing and other web type processing is needed.
Weaknesses:
Not as powerful as PERL when it comes to string parsing/regular expressions
Speed:
?
ASP
?
Best Used:
Um, database, something...?
SSI
Strenghs:
Ideally suited for adding a few dynamic elements to a mainly static page. eg: adding navigational menus; current date etc
Best Used:
Because SSI is embedded in static html pages, it is ideal for where a small amount of the page is dynamically generated, and the majority is static
Weaknesses:
Not suited as a full blown processing language(?)
Speed:
Quite fast(?)
Cleary I have some holes in my understanding, which is why I've posed the question (in my case I'm a PERL expert, but I'd like to learn to use the 'best tool for the job' for each of the right occasions).
I thought it would be useful to gain a consensus on when each server side scripting format/language should be used, and the advantages, disadvantes, and execution speed of each.
SSI is nice for little stuff, but I found that I very quickly ran into its limitations. Unless it has gotten more powerful since I last used it, there are no flow-control statements. If what you're doing is really simple enough that you never need an 'if' statement, though, they are simple and easy to use.
ASP - no clue. PHP can do anything I've ever wanted to do. So can Perl. ASP makes me think of IIS, which makes me cringe. (I hate windows, and only partially because I'm a Free software fan. I don't want to start a religious war about OSes, though, I just mention it because it may be relevant for people trying to evaluate my oppinions.)
- Tony
<aside>I've used Apache, IIS, and Firstclass (a very obscure web server), and I've found them all to be roughly equivilent in performance, security (when properly maintained), and ROI. Which webserver to use depends, in my opinion, more on the background of your staff than on the strength's and weaknesses of the server itself.
</aside>
Richard Lowe
With mod_perl you get even more than a server side scripting language. You are within the server and are free to do anything you like. This is great for larger web applications. I suspect (itīs all I can do since I donīt know java server pages) mod_perl to be en par with some java application server in that respect.
PHP is great for your ordinary scripting and shared hosting. Since I donīt like PHP all that much, my CMS (written in Perl) will produce the PHP code for me from different templates and classes.
Sometimes [Perl] takes a couple of extra steps to perform web specific tasks when compared to PHP.
Just build your own module containing shortcut functions like the ones available in PHP and itīs no longer a problem.
Andreas