User login

On Perl's Learning Curve And Its Relative Capabilities

The big problem with Perl is that it’s easy to learn, but difficult to learn right. It has a tough learning curve and it can take years to master, even if you already know many other programming languages.

However, I’ve never met a person that uses the advanced features of Perl (closures in an OO context, hash dispatchers, higher-order methods, super general functions, and so on) that didn’t write beautiful, concise, fast, and bug-free code. People that really grok Perl (and there are precious few of those because of the learning curve) don’t bash Perl.

The only relative advantage that I see in Python or Ruby is the learning curve and general readability. It’s much easier to become a good Ruby or Python programmer than it is to become a good Perl programmer. With Python, for example, a beginner is going to write code that he or she and other beginners will easily be able to read later. On a language-feature by language-feature comparison, however, Perl does almost everything better than those other languages.

There are readability issues with Perl because Perl is expressive and provides a great deal of flexibility. People that are not Perl masters can easily write code that other people at the same level would have trouble reading. In some cases, non-masters have trouble understanding even their own code.

I believe that the most powerful language available today is Lisp and that Perl is popular among great programmers because Perl has many of the features of Lisp and it implements them well. PHP is to Perl what Perl is to Lisp. I've been using Perl for many years to do things that C# is just able to do now. But Perl still does those things better than C#. Python is somewhere between PHP and Perl, and very close to Ruby in terms of power. Ultimately, the best measure of the power of a language is the average amount of easy-to-read code that it takes to accomplish a wide range of tasks. Perl can do in one readable line of code a great many things that might take at least 30 lines of less-readable Java code to accomplish.

Some languages are better at some things though. Perl can't touch XQuery for manipulating XML. No one has written a Perl module that makes it really easy to search through or apply complex transformations to XML in a Perlish fashion.

All languages, even XQuery, progress roughly toward Lisp. New languages, in general, look more and more like Lisp.

Perl ranks pretty high in comparison to other computer languages in terms of its general usefulness for solving a great variety of problems. It is among the languages with the most features. It is by far the most popular language with so many features. It has a vast and well-organized library of modules that can be used to quickly assemble applications. But it's not the most powerful language and certainly there are lesser languages that can perform some specific tasks far better than Perl.

Like Lisp (well, a little like Lisp) and to a greater degree than most other programming languages, Perl can make you a better programmer. Smarter, if you will. And that's another indicator of the power of a programming language.