As a programmer who is addicted to Perl, I am curious as to why Perl is
losing ground to another bunch of languages, namely: Python, PHP and
Ruby. I'd like to hear your opinions. Is Perl just not "trendy" anymore?
Does it still scare programmers who haven't used it? Or do the other
languages have any major advantages over Perl? I haven't worked in these
other languages, so I'm not qualified to have much of an opinion here.
What do you think?
- Dom
I think people are fond of PHP for web stuff due to the inline coding
you can do, which is similar to ASP on a MS platform. To a MS web
programmer writing a cgi program which spits out HTML code is wierd.
Don't know about Python or Ruby, but I am very interested in learning
both.
In general, I think that Perl is slightly less popular now(judging
from internet job postings) than it was a few years ago for two main
reasons: A) a general trend toward OOP and B) simpler syntax in other
languages.
I know people will say that Perl can be object oriented, but of course
it was an afterthought with Perl. Other languages were designed from
the ground up to make Objects easy to work with, and not allow a mix
of procedural and OO. As projects and applications get larger and more
complex people want to use OOP, so they pick a language which is
purely OO, and which implements it cleanly.
People also get turned away by Perls syntax. Readability is the key. A
language which allows something like this:
x!($_%7)||$_,$/;z($_+1);
is going to be harder to read than a language which uses this:
print((isFactor( 5, inputString ) || isFactor( 7, inputString ) ||
inputString));
I know those are not the same thing exaclty and wouldn't come close to
compiling, I just don't have time to write them both completely. The
point is that in Perl, brevity has taken the place of readability.
This GREAT for one-liners, etc but for anything which you have to read
it later, it slows development to a crawl. Even on this newsgroup, if
you try to write readable code, people tell you your variables are too
long, you are using too many methods, etc.
I recently replaced a script on a server at work written by someone in
Perl about two years ago. There was no documentation, and it took me a
few hours to read thru it just to see WTF it did. In fact it took me
less time to re-write it's replacement in Perl than it did to read it
and understand it in the first place. As as aside, the reason I had to
read it in such detail is because no one could remember what exactly
it did. The Perl motto on the Camel book says "There's more than one
way to do it." While the freedom to choose is certainly an advantage
when talking about government, or deoderant, or what to have for
dinner, I think it hurts a programming language in the long run
because it hurts readability. Just my $.02, coming from someone who
spent 5 years in school getting readability and documentation hammered
into me so take it for what it's worth.
That being said, I am going back to program some more Perl, but
luckily it's a small program.
-Greg