34 points · by fogus · 16y ago · 87 comments
I would agree. A little over a decade ago, Perl suffered from the same problems which plagued JavaScript in its early days: ease of writing shitty code, mountains of shitty sample code, and a community which did not vehemently encourage the writing of unshitty code.
This caused a backlash which lasted several years, during which the programming public panned the languages almost universally.
But a funny thing happened; rather than shriveling up and going away, the languages and their practitioners matured. Community focus became less centered on glue code and scrolling effects, and attention was shifted to writing clean, maintainable code which uses the language's best features (metaprogramming, easy hash/object manipulation, etc) in manageable, modular ways.
Now both ecosystems are flourishing, and though Perl doesn't have quite the install base of JavaScript, it's still a viable contender to Ruby and Python in their areas of expertise, and it can be called the best tool for some of those jobs.
That's not how I remember it. Perl usage started to really fall off when PHP became popular and replaced modperl/ cgi scripts as the common way of throwing together a dynamic webpage. PHP is a language famous for letting people write shitty code and having a "community" that doesn't discourage it.
PHP is (very mildly) comparable to Perl's Mason template engine, if Mason were the only way to use Perl.
Are you saying that perl usage had started to fall off in these areas before it lost its crown as the lingua franca of the web? Possible, but again that is not how I remember it rolling out.
I will take your word for it, but I do have to say (speaking as someone with a lot of grey in his hair) that I haven't seen a young developer choose to work primarily in perl (over ruby or Python or Java or C#) in ages. Most new projects/startups don't seem to choose perl as their primary language.
I readily concede that this is probably an artifact of my limited experience with perl. Just noting what I see, not looking for a flame war.
How many of YC companies use perl do you think?
By the numbers, though, I still agree with the quoted statement. Perl development is picking up compared to the past few years, and enthusiasm for Perl 5 is the strongest it's been (at least since 5.0).
I've also noticed over time that lots of non-CS majors can and do program in scripting languages because they are relatively easy to pick up and get things done with. These people are usually more aligned with an IT career in that scripting constitutes only a fraction of their job. If they happen to learn Perl and PHP first, then that is what they stick with.
These people may like to program, but it is not the favorite part of their job and they have other work activities they enjoy more. More importantly, they know little to nothing about software design principles and are not interested in improving their software development skills. They would rather spend their time learning about something else that interests them more. Therefore, they don't even know how to appreciate the advantages more modern scripting languages offer. To these people, languages like Perl are more than sufficient to get their job done, and they are probably right.
However, as people who know better, I believe we should be encouraging better languages in a friendly way whenever possible. When my IT friends ask me about any questions related to programming, I usually try to point them to Python or Ruby for a solution. If they are asking questions they are probably interested in learning something new!
edit: changed wording based on reply from gamache.
In fact I would invert your statement: I think Perl is not a good choice for people without good programming habits, but for those who know how to use it, it offers more power of expression than most of its peers.
(Also, datum: count me in as an "older person" preferring Perl for most tasks despite knowing Ruby, Python, JS and half a dozen other languages.)
Reasons? Friendly, knowledgable community. CPAN and Catalyst.
Admittedly I don't know any other [under]graduates using Perl (outside of bio/geology).
That's probably something of an overstatement, but I've written Perl in the past months for gigs, even though I have long abandoned it for Ruby. I don't know that I'd call the general interest in Perl5 "enthusiasm" -- that's a word I'd save for Ruby/RoR and maybe Python and DJ Ango. ;-p :-)
Perl5 is mature. There are modules for anything you can imagine, and most seem to be well-maintained. It's still useful, if someone antiquated in feel.
Perl6: that's another story. It's DOA. People will point to this implementation and that one, but the lack of a reference implementation, along with the long development time, makes Perl6 the Duke Nukem Forever of scripting.
(If I were snarky, I would note that the next COBOL spec after that -- yes, there is one -- might well be released before perl 6.)
Also, Perl 5 is feature-stable, and probably always will be. Python is in this 2.x-3.x limbo right now where it's difficult to find libraries that are going to work as-is for much longer. If you write a Perl application well, maintenance will as easy as reasonably possible, which I think is the only real measure of a good language. Most of the 'ease of use' problems disappear once you know what you're doing, and the language learning curve is a relatively small part of a programmer's life-cycle.
Perl has supported arrays of arrays since 1994.
Pointers are not reasonable in a high level language.
Perl has never supported pointers.
Explicit function signatures are a superior language design.
I agree with this. Perl 5 should have had them years ago.
The problem with CPAN is the same things as RPM hell or DLL hell, only worse and more fragile. On a large project, you really don't want to randomly upgrade your DBI module, or some other small perl package that may bring your whole project down. But then one day you need to use Net::SSH and it wants to upgrade DBI::Search for some bizarre reason, which requires you to compile a beta version of the GZIP library because it's using some new interface that's not included with your CentOS 5 install. Then you find out DBI::Search requires DBI 1.41 and you're only using 1.40. There's a backwards incompatible behavior that affects your code in 1.41, which is why you haven't upgraded yet. You go through all 100k lines of your project and make sure all the DBI code handles this new case.
Then you have to try and install the changes on all 75 of your servers. You may have some sort of capistrano script to make this simpler, or you may have used RPM versions of your CPAN packages. Neither solution is less painful than the other. CPAN wasn't really designed to work with your sysadmin's workflow, so neither solution is particularly useful.
At the end of the day, you would have spent less time just writing the damn code yourself to call out to the ssh binary.
If you're running through 100K lines of code to test a DBI upgrade you're clearly not testing properly. Not that most CPAN modules break compatibility. It's very rare that something like a DBI upgrade will break anything. All the good module authors are very careful.
Could someone explain what this means in some detail? I hear this all the time but I could never make any sense out of it. Sure once upon a time perl was the best way to get cgi scripts running and do some web programming. Other than this piece of history, any specific examples of the "holding the internet together" property perl is supposed to have? What part of critical internet infrastructure depends on perl?
I am no networking expert but it seems to me that a lot of the infrastructure (apache, tcp/ip stacks etc) is written in C. How (specifically) does perl hold the internet together any more than any other scripting language? Or is this jusr something perl aficionados tell each other ?
These things are equally important, and yes you could probably find a substitute, but why?
Argument by metaphor is a lazy device. I don't see any specific "mortar like" virtues that perl has but other common scripting languages don't. In this metaphor I guess C Code would be the "bricks and steel beams".
Why can't I put a unix box together without perl on it? Is there any specific piece of perl code that has to be on a unix box to enable it to work as an internet server or router? Is there a piece of code that has to be present on a Unix box for me to deploy say Apache or for dns to work? Honest question. Looking for concrete answers.
What specifically does perl do to "hold the internet together" today?
As an aside, I remember some COBOL programmers saying COBOL (running on mainframes) underlies all business on the internet and so COBOL was the real "internet commerce " language. Sure, you can say it and it can be justified by a lot of convolutions and narrowing of vision, but the truth seems to be that if it ever was so critical it is (a) an accident of history and (b) getting less true with every passing day.
I suspect (but am willing to be corrected) that perl is not indispensable to the internet any more (if it ever was).
...and it is my glue. So many things in my environment wouldn't happen to be able to talk to each other if it weren't for Perl.
Perl has all of these things. If you're coding in Perl and you write bad code, it's your fault. If Perl has a fault, it's that it's easy to write code that you think is done, when you have more work to do if you want to develop a full-scale application. However, you can write incomplete but good-enough code in any language. (And I will always use Perl to write once-off scripts. It's perfect for that task.)
My last project at work was rewriting a 4k line monstrosity in Perl into 500 lines of Python which do exactly the same. I can't even blame the original authors (it was likely their first larger program), it's just that Perl makes it so easy to write horrible code.
I know that Perl's defaults (mainly lack of strict and warnings) can make it easy to write code that easily breaks or has bugs or is harder to maintain, but it is the first time I hear the argument that it make it any easier or encourage someone to write 4k lines when he could have written 500 lines.
I would guess that guy would have created a 4k monstrosity in Python if that's what he had to use without having enough experience.
Or maybe I am not being imaginative enough? Can you give examples from the program you rewrote where Perl encourage beginners to write "huge monstrosities" while Python would have encouraged them to write succinct code ?
So yes - some people will still write perl, but it will be an obscure language one day (hopefully).
That's a silly argument. Do you know of any language where beginners don't have to learn between language primitives to create complex data structures, for example? Assuming (for example) that parentheses create lists and that lists are first-class data types in Perl (and neither is true) is a fine example of Blub programming false cognates.
However that said, Perl cuts releases of old branches from time to time. So 5.8.9 was released a year after 5.10. See http://search.cpan.org/~jesse/perl-5.12.0/pod/perlhist.pod for a full release history.
I learned perl in 1996 in order to cobble together a system that collected reports from all sorts of weird text files and formats (anyone remember Framemaker?) and merge them into one nice big postscript file with custom watermarks and page numbers. This program ran for at least 8 years after that. I had to learn perl in the dead of night because I had been instructed to find a "technology solution" and perl was "unsupportable".
Another totally different program was developed to prototype a large orchestration of securities valuation and hedging. It even had numerical optimization in it. It was taken wholesale into production.
Many other programs, some fairly long, were written in order to run successfully only once, and then they were retired.
I loved perl.
Then I learned python and could read the code that I wrote a few months ago and more importantly, read other peoples' code more easily. Consistent white space helps a lot. It had many of the same advantages of perl, with slightly clunkier regexes, plus a nice system for introspection. It could almost replace matlab--almost.
I built a complicated optimization system that orchestrated multiple processors and called C++ library code so I didn't have to learn C++.
I forgot about perl. I loved python now.
Then I learned haskell and forgot about python but that's enough for today.