2007年8月5日星期日

Perl is Dead. Long live Perl.

Perl is Dead. Long live Perl. - O'Reilly ONLamp Blog

It seems every day I am questioned about why I write in Perl versus PHP, Java, C#, Ruby, Python, or [insert your favorite language here]. People say things like, "Perl isn't used anymore is it?" or, "Ruby on Rails is all I read about anymore." As I write this, there are millions of Perl programmers around the world. Perl 5 is being actively maintained, and Perl 6 is in development. More than 3000 Perl Modules were released in 2006, and more than double are on track to be released this year. The reality is that Perl is far from dead.

Let's say for a second that Perl actually was dying. Even if that were true, it would be a slow death over years to come. The reason? Businesses have billions of dollars invested in mission critical applications written in Perl that can not be easily replaced. For the sake of comparison, people have been saying that Cobol has been dead for more than 20 years, but there are over 1000 Cobol jobs per month posted on Monster.com, and more than 5000 per month for Perl.

In the past five years Perl's usage has grown by almost 700%. This leads people to question why it looks like Perl's market share is sliding. The answer is that they typically use web site development as a measure of marketshare, and the percentage of the web that's programmed in Perl is shrinking. Is that due to people not using Perl? No. Absolutely not. Instead, it's just that there are more web sites and more programming language options. Ten years ago almost all web applications were either written in Perl or C, but since then dozens of new languages have caught on. In addition, there are an estimated 20 million new sites put up each year. Even though the number of sites created in Perl doubles every year, tracking it by percentages will make the numbers seem to shrink.

Still don't believe me? Well, how about we examine a small swath of really big web sites that I'm sure you have heard of and used that are either built entirely on Perl, or have significant portions written in Perl: Yahoo!, Amazon, TicketMaster, The United States Department of State, The BBC, Slashdot, and Shopzilla. Have you heard of any of those? I thought so.

To address the "Why Perl?" part of the equation, let me first point out that Perl was designed to be an ultra flexible text processing language. What is the Internet if it's not text? Nearly every protocol and document standard you interact with on the web is just text. HTML, HTTP, SMTP, XML, CSS, Javascript…that's right, all text! It is only logical to choose a programming language that was designed specifically for text processing when you're working on the Internet. Java and C# are designed to be generic do everything languages. PHP, ASP, Cold Fusion, and JSP are all designed for the web only. Ruby and Python are also both good choices, but they don't have nearly such a large library of code as Perl.

In addition to being a great text processing language, Perl provides a wealth of flexible coding possibilities. It has plugins to support and manipulate a variety of binary file formats, inculuding various forms of encryption, compression, and images. The Comprehensive Perl Archive Network (CPAN) provides coders thousands of easily downloaded modules that do everything from writing network services to parsing Microsoft Excel documents. Perl has also been compiled to work on dozens of hardware platforms and operating systems which allows code to be written once and used on virtually any system. In addition to this compatibility, Perl has been heavily integrated into the Apache web server in the form of mod_perl, which means that Perl can do anything that Apache can do.

If Perl is dead, then it is by far the most vital, active and useful deceased programming language I have ever come across. Perl is, in fact, alive and thriving, and it is uniquely suited to a variety of programming projects with its flexibility, power, and extensive code base. I write in Perl because it provides everything needed to support enterprise software applications. I write in Perl because it is actively being maintained and developed. I write in Perl because nothing else gets the job done better: long live Perl.

没有评论: