Blog This!   Lee Geistlinger's Web Log
Blog Home
Blog Archives
LittleGhost Home

E-mail: geistlinger AT gmail.com

Loading
Pic 'O the Day
Top 10 Lists
Everyone loves lists
Reviews
Books, Movies and so on
Blogroll
Feed Me!

XML Feed

Feeds I Read

My Online Aggregator

Theme
• Default
• Spring
• Summer
• Autumn
• Winter
• Black & White
• Gray & White
• MT-ish
• Classic
Listening To...
Evidence of Efforts

This page is powered by Blogger. Isn't yours?

Valid CSS!

[Valid RSS]

Recent Posts
 Friday, March 19, 2004
Reflections on Scripting Languages

The Web continues to evolve, and with it the purpose and power of Web scripting languages. I've blogged about scripting languages - many times, RE: many issues - in the past; with the rise of .Net and the imminent release of PHP 5.0, perhaps it's time to take another look at these languages.

Outside of the compiled vs. interpreted language differentiation, I don't know what the best definition of Web scripting languages is. For example, I consider Perl a Web scripting language (one of it's many uses), yet Perl is compiled - at run time.

Oh well. Consider this a look at the following Web scripting languages:

There are other contenders - such as Lasso, a horrible, horrible language - but I will stick those in the preceding list. And I leave out the templating systems, except as they may pertain to a specific language (such as smarty on PHP).

All opinions expressed (except as linked, obviously) are my opinions; all errors are mine, as well.

ASP
First of all, let me begin by saying that I haven't done any professional ASP coding - stuff I've been paid for - and I don't have any experience with ASP.Net or whatever the fuck it's called. So ignore the following if you're already rolling your eyes.

That said, when I taught myself ASP, I didn't build a HELLO WORLD page - I built a password-protected, session-enabled CMS that had a visitor section and admin section (add, edit, soft-deleted users and articles etc). So I don't have a lot of experience, but I know a bit about scripting languages.

When I first began work with ASP, I was surprised that it was so well thought out. When I needed a function - based upon my work in other languages or it just seemed like it should be there, it was.

On the other hand, VBScript just totally blows. I just don't like it. I do have VB experience (again, minimal), but ... so what? I would have vastly preferred to use JavaScript as the logic for the ASP pages (ASP allows this), as JS is such a strong language. However, this doesn't make a lot of sense - the whole "When in Rome, do as the Romans do..." point of view. The default is VBScript, most (all?) ASP coders are familiar with VBScript and probably not as familiar with JS, and I think there is a setting you may have to make on IIS to use JavaScript (could be just a default change; I can't recall).

There is a lot going for ASP, however, and - as mentioned - I don't know the whole ASP.Net framework, and I'll bet that's even better than the base ASP language. Also - very importantly - if you're a dedicated MS house, ASP is probably the best bet: ASP is more tightly integrated into the MS framework than any other scripting language (leaving aside the debate if that's a good thing or not, OK?).

Bottom Line Pros:

Bottom Line Cons:


ColdFusion

This is probably the language that I'm most familiar with - I've just worked at more jobs where this was the language of choice. Not necessarily an endorsement; not necessarily a ding. Reality. So be it.

ColdFusion - originally a product of Allaire, purchased around 2001-2 by Macromedia - is probably the poster child for simplified dynamic Web development. While other languages may scale better or support more C-type functions better, ColdFusion is the easiest language to hook up to a database and template out a dynamic site.

ColdFusion has excellent - almost transparent - database interaction features. It also makes handling sessions - another huge Web-language issue - relatively trivial. Combined with a tag-based format that reads as English, this makes ColdFusion an ideal language to allow newbies to begin experimenting with database-driven sites.

Not surprisingly, the strengths of ColdFusion also work to its detriment: Simplification reduces the ability to do the complex (at least as proportionately easily). One example of this is the most basic: Because CF is so easy to code, there are a lot of individuals out there who are (shiver!) running CF sites who really don't have programming chops. CF allows this - double-edged sword and all that. It's hard to find a Java programmer who doesn't know some basic best practices (uh, say separation of logic and presentation as much as possible). Most CF coders don't understand this basic concept.

Bottom Line Pros:

Bottom Line Cons:


JSP (Java Server Pages)

As with ASP, I have limited experience with JSP - mainly to teach myself how they work and all that.

There really isn't a whole lot to say about JSP except the following, which will double as the Pros and Cons of the scripting language:

Note: Russell Beattie has an interesting blog entry about JSP. Kind of a State of JSP entry: The good, the bad, and the fugly...

Perl

Before it was simple - or practical - to create a database-driven site, there was Perl. Perl CGIs, along with Unix include files (remember .shtml?), were the dynamic Web.

Today, Perl-driven sites are dwindling; many that are left (such as Slashdot) are holdovers from when Perl was the only way to do things. If these holdovers were launched today, they'd be in one of the other four languages described here, in all likelihood.

Perl, for all it's strengths, was not designed as a Web scripting language. It was just a simple leap to make it such: Perl excels at text handling/transformation. HTML is a ASCII-text language. 1 + 1 = A dynamic solution. However, the lack of a Web-centric foundation makes Perl somewhat awkward to work with for Web development, especially for code monkeys (as opposed to trained developers).

For example, most scripting languages come built with constructs to handle the basic HTML GET and POST parameters (and so on). Until the Perl CGI module(s) came along, handling these variables page to page (such as a registration form) required a developer to create a custom subroutine to parse and make these variables available. Doable, but not clean or consistent (the biggest drawback).

And while Perl does have database connection tools (through the Perl DBI), Perl's forte - as mentioned above - is text handling, and is often used in conjunction with flat files (delimited TXT files) as a non-relational database. Perl rocks for such work.

Bottom Line Pros:


Bottom Line Cons:


PHP

PHP is currently my favorite language. It combines the Web-centric designs of ColdFusion and ASP with the robust text-handling ability of Perl to make a language that is not without its flaws, but one that is ideal for Web development.

PHP was designed from the get-go as a Web scripting language: PHP originally stood for Personal Home Page (today, PHP = PHP: Hypertext Preprocessor...yeah, just rolls off the tongue...).

As mentioned, it combines the best of many languages, including Java, into its framework. With the C-like syntax and expected higher-level functions (example: all the math functions), PHP can - out of the box - handle almost any Web task needed.

And with a little extra effort/expertise, PHP can be tweaked with non-standard options (such as ClibPDF) to handle virtually anything you can throw at it.

I thought that PHP would die out - be drowned out, if you will - in the tidal wave of (somewhat) proprietary scripting languages (ASP on Windows side, JSP on *NIX side). I was quite wrong. PHP seems to have grown in importance and visibility. It's interesting.

One major downside of PHP is the way the language keeps changing: Moving forward is OK, but it seems like everytime I look up a function (at the great online resource php.net), there is a note limiting it's use: (PHP 4 >= 4.1.0).

The leap from v3.x to v4.x was huge and to leave v3 users behind was a good more. But the mess is that there are a lot of v4 functions and so on that don't work unless you have version 4.x.y, which is somewhat problematic. At it frightens me to see what the new version - 5 - will bring (currently a release candidate; so almost there).

Bottom Line Pros:


Bottom Line Cons:


Conclusions

The first thing to take from this (very rough) comparison is a given that I approached this exercise with: Languages are not right or wrong, they are just potentially convenient.

The best car? For what? Road rally or taking 12 kids to soccer practice?

Ditto for languages.

That said, some rules of thumb for choosing/using a scripting language:
Scripting Language Choice(s) - Rules of Thumb:

  • Yes, it's hard, but do some research to determine what will work best for your now (basically most of the scriping languages listed above) and in the near future (harder; hints below)

  • Of the listed languages, only ColdFusion may expire: ASP has MS behind it; JSP Sun/the Java Community; Perl...too pervasive and useful to die (not grow? Possible: Doubtful, but will still rock); PHP is OSS, and it has struck a nerve with developers.

  • ASP is great for MS-only shops with a lot of VB or C++ experience, so you can tie in COM objects

  • Java is THE server language for non-MS shops; JSP is (sometimes logical) face to beans/servlets and so on. As long as Java is around, so will JSP

  • Perl is not a Web scripting language (at foundation level). I will always (?) use Perl, primarily for scripting, log file transformation and so on, but I don't want to do a full Perl site. But that's me.



- Posted by Lee at 2:58 PM Permalink #
^Top | Top Ten Home | Blog This! Home | Blog This! Archives