Had I not been at work, I might have nearly fallen off my seat laughing as I read item #3 in You Used Perl to Write WHAT?! on page 2. You see, the author is taking about where Perl is good and bad, and he says "there are some uses that just aren't right." That' followed by a list of items. Here's number three.
As a Web scripting language: One of the earliest usages of perl, as the Web evolved, was for CGI programming webpages. As a result, perl has some pretty strong packages for dealing with Web forms. There is also support for embedding perl into HTML in the same way the Java is embedded into JSP pages.
However, I would argue that more modern Web scripting languages, such as PHP and Ruby on Rails, offer more out-of-the-box Web support and a cleaner integration into the webpage experience. You should especially avoid using perl for traditional CGI-style form processing; this code tends to be hard to read and maintain because the HTML ends up inlined inside the perl code.
Now maybe it's the fact that I started coding in Perl about 12 years ago. Or maybe it's the fact that I've used it quite successfully in various web projects over the years. But suggesting that Perl isn't a good web scripting language is rather laughable.
Now, if you're starting from scratch and looking to learn a new language primarily for building web applications, that's one thing. Sure, look at PHP, Ruby, Python, and whatever else can do the job. But the author seems to be saying that it's worth learning yet another language simply for building web applications.
That's messed up.
Have a look around CPAN and at the web frameworks that exist around Perl and mod_perl. Heck, some of them have been around a long time and are quite mature. Saying that Perl "has some pretty strong packages for dealing with Web forms" doesn't really capture the true state of things.
I think programming language battles are as dumb as the next person, so I generally try to avoid them. But when I see stuff like this, it's hard to keep my mouth shut.
As for the claim that traditional CGI-style form processing being hard to read and maintain... WHAT?! There's nothing hard about separating the HTML from the code.
Okay, enough of my griping...
Posted by jzawodn at January 25, 2008 01:02 PM