4 ms·
I got attacked recently for bashing Perl and supporting Python in an HN comment. I was scolded for being a religious fanboy, but I've used both languages for re
by andrewljohnson 17y ago
I got attacked recently for bashing Perl and supporting Python in an HN comment. I was scolded for being a religious fanboy, but I've used both languages for real work, and I don't see any reason to start a new project in Perl, given the alternatives.
What would Perl be better for these days over modern scripting languages, besides maintaining a legacy system? I suppose if all you know is Perl, it might be the right choice for a new project as well.
Perl is for legacy people and legacy code.
- jey 17y ago> What would Perl be better for these days over modern scripting languages, besides maintaining a legacy system? Job security.
- jrockway 17y agoPerl is for legacy people and legacy code. Well, so is everything else. The "state of the art" is about 30 years behind the newest ideas. I am confused as to why you exclude Perl from the group of "modern scripting languages" -- Perl 5's object system is stolen from Python, for example, which means it's newer (and therefore more "modern") than Python. Anyway, Perl's advantages for writing new code is its library ecosystem. It is continually evolving to incorporate new ideas and make them easily usable for the average developer; easily usable in a way that allows them to keep their old code alive and working, but while making their new code much better. An example of this that always comes up is the Moose object system. It interoperates with Perl's rather-limited built-in object system; this means, you don't have to throw away your old code to get the advantages of a new object system in your new code. And, it's newer than all of Ruby, Python, Smalltalk, and Common Lisp, and it learns from all those object systems and provides Perl with something better than those. I would go so far as to say it's a compelling reason to continue to use Perl and to choose Perl for new applications; when I write OO code in languages other than Perl I am always wishing I had certain Moose features. (Usually lazy_build.) I usually end up with something that doesn't quite work the way I want it to, which is sad. In Perl, I always get what I want. (How would I write something like Test::Sweet in Python?) Perl also has a few more libraries than Ruby or Python or PHP. This probably doesn't matter for your average application; you are going to be able to connect to your MySQL database in any of those languages. But it is nice when something strange comes up; there is usually a library than at least partially solves your problem. That's a product of keeping Perl 5 stable and gradually adding new features. Python's strategy is "hello, there's Python 3 now, it's awesome, oh yeah, just rewrite all your apps and libraries!" which is not as conducive to keeping the library ecosystem alive. So anyway, "Perl is for legacy people and legacy code" is clever and true. But it's also for modern people and modern code. The real world requires both.
- ajross 17y agoThis is silly. If you don't like perl, you don't have to use it. But don't pretend that these are hugely different languages; they're much more alike than different. The choice between them is really one of taste only. If you can't see that, I honestly have to question the extent to which you've "used" these languages.
- chromatic 17y agoLest I repeat myself from last month: http://news.ycombinator.com/item?id=990301 http://news.ycombinator.com/item?id=990301 Oh, and the number is now ~19,438.