4 ms·
The whole article fails to mention any advantage of Perl over the languages it's compared to (wonder why). The sooner Perl falls into obscurity, the better.
by jergosh 16y ago
The whole article fails to mention any advantage of Perl over the languages it's compared to (wonder why). The sooner Perl falls into obscurity, the better.
- flogic 16y agoThat's because Perl Python and Ruby offer essentially the same feature set. The only significant differences are syntax and CPAN.
- berntb 16y agoWell, Perl arguably has a nicer OO system with Moose... :-)
- DrSprout 16y agoI currently code for my day job in a proprietary extension to a proprietary dialect of BASIC from the mid-80's. This language is legitimately broken, and has significant disadvantages at every turn. It has no real functions, no block-level scoping, lists are stored as delimited strings, there are no hashes, and nothing even resembling objects. 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.)
- jergosh 16y agoIt's all fine until you have to work with bad legacy code ;) 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.
- patrickas 16y agoWhy can't you blame the original author since you know it was likely his first larger program? 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 ?
- mock 16y agoBad legacy code is certainly unpleasant. I'm currently working with a large code base that was mostly written about 10 years ago. It's not even particularly bad code, it's just big, and old, and crufty. But we can refactor that code a bit at a time into something clean and new, using modern perl. And we can do that without having to rewrite the entire thing in one shot. And that's one of the many advantages that being a good perl developer gives you. Another one is that that giant legacy code base still runs on a modern perl binary, because perl is (with a few well documented exceptions) a very very stable language. Most of the big modern perl changes are just modules. And they're backwards compatible with the old stuff too.
- viraptor 16y agoBut that's because you already know perl. For new people... I don't see a reason to go there. Perl smells funny - there are better alternatives that don't require you to spend time learning (for example) what can be referenced, what cannot, when is \ not taking a reference, why I cannot have lists-inside-lists, and how is that different from arrays anyway, etc. And that's only one source of that funny smell... For beginners, there are loads of languages which offer consistent behaviour and once they learn that, perl will be the odd one you don't really want to touch. So yes - some people will still write perl, but it will be an obscure language one day (hopefully).
- chromatic 16y agoThere are better alternatives that don't require you to spend time learning .... 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.
- viraptor 16y agoThere's a difference between learning the difference where the language is consistent and when it handles everything differently. I see many problems, but staying with the list thing: \ creates references, () creates lists, \$a is a reference to $a, \($a, $b) is not a reference to an array, but it's (\$a, \$b), [$a, $b] creates a reference to an array without \. If I have a choice, I'll take a consistent solution instead.
- chromatic 16y agoHere's your problem: if you skip learning the basics of the language -- if you assume that the fundamental behavior of a new language is the same as other languages you know -- you will suffer constant friction and confusion. Lists and arrays are not the same thing in Perl. Parentheses do not create lists in Perl. Parentheses group terms. You'd have the same sort of problem conflating tuples and lists in Python, especially if you don't know about the special comma syntax and zero-or-one element tuples.
- ledger123 16y ago"The answers are longevity, maturity, and a rich ecosystem of development tools and modules that developers can leverage for almost any programming task. Consider the Comprehensive Perl Archive Network (CPAN). CPAN is an enormous collection of software and documentation, largely unmatched outside of the Perl community. Yes, other languages have similar repositories patterned after CPAN -- but thus far none have matched CPAN for its size and scope. CPAN continues to grow at a rapid clip."