6 ms·
I find it disheartening how much people trash talk Perl, while other languages that are extremely similar (JavaScript, Python, Ruby all share much more with Per
by SwellJoe 11y ago
I find it disheartening how much people trash talk Perl, while other languages that are extremely similar (JavaScript, Python, Ruby all share much more with Perl than they do with, say, Haskell or Go or ML), get a pass. It's become trendy to do so, to the point where people who clearly have never learned Perl or worked with it feel entitled to speak with authority on it. Taking it to the point of dismissing anything Perl's creator has ever said (as one of the commenters on this wiki page does) is absurd and means not listening to an extremely bright technologist (I mean, c'mon, Larry invented patch, the basis of a tremendous amount of awesome in modern software development!).
There are misfeatures in Perl, certainly, but there are roughly as many misfeatures in JavaScript. It's silly to dismiss it as "awful" when there's so much that is clearly nice about the language for many categories of problem.
- sspiff 11y agoI never used Perl, but I use Ruby where people might have used Perl before. (Small one-off scripts or simple automation stuff) People often attack the appearance and readability of Perl code ("write-only" code), but lot's of Ruby code I come across has the exact same problem, except that people seem to love adding 4 or 5 extra layers of abstraction on top of that.
- krylon 11y agoOne can write totally incomprehensible code in any language if clean, readable code is not a priority. And the opposite is true, too, of course. I have seen some fairly messy Python code and some marvelously clean Perl code. And I am fairly certain that over time, some people have written beautiful PHP code and ugly Lisp code. In my humble experience, it is not so much a property of the programming language as it is of the programmer(s).
- AdieuToLogic 11y agoYou make an excellent point which, unfortunately, is often not remembered by practitioners of our field (myself included).
- teddyh 11y agoIn the 90’s I learned and used C as a general programming language. For lighter tasks, I used shell scripts, sed, and awk, and I came to know them well, and I still use them regularly. I knew then that I needed a better programming language for general programming, and from a distance, I could see that Perl was like shell, sed, and awk all mashed together. I did not want it – it seemed like the entirely wrong direction to go. (Minor or domain-specific languages like PHP was out.) I had heard of Python, but did not try it until I was asked to write a small utility which was just complex enough that a shell script would not suffice; I took the opportunity to learn and use Python (then version 1.5) for it. I have used Python at every opportunity since, and am happy to use Python 3 everywhere possible.
- ddrum001 11y agoI suppose those who only write in relatively similar languages like JS, Python, and Ruby start seeing all the tiny differences and miss the entire subset of Lisp languages that offer so much more.
- wmil 11y agoPerl's critical failure is that most CPAN modules expect admin rights and a gcc build environment in order to install correctly. That killed it on shared hosting and for small projects that may not have a server admin's support. Also devs are used to having named arguments for their functions. Not supporting that is just silly. And finally it's difficult to google things like $/, $", $% and $_ when you're confused.
- justinator 11y ago> Perl's critical failure is that most CPAN modules expect > admin rights and a gcc build environment in order to > install correctly. > That killed it on shared hosting and for small projects > that may not have a server admin's support. I install Perl apps on shared hosts all the time. The great majority I work on are cPanel-powered. They have a CPAN module installer right from within the cPanel. Compiler support is an option, and is usually enabled by default. If it's not, it's easy enough to enable that in WHM (the cPanel for cPanel accounts basically) cPanel is available on hosts like Bluehost, Hostmonster, (dog help us) GoDaddy. Most hosts that built their own control panel for hosting accounts have thus moved to cPanel. cPanel, no surprise, is a Perl shop themselves. So, the 800lb gorilla of shared hosting control panels presently does what you say you can't. I also ship Perl apps that specifically do not require outside CPAN Perl modules that require compilation, but have support for features, if they're present. Throw up the .gzip distro, throw up, "install.cgi", chmod 755, and visit the thing in your browser. It wasn't impossible ;)
- raiph 11y agoIt'll be interesting to c how the radically overhauled module management in Perl 6 pans out. (They're making sure that installation is practical. For example, NativeCall, for calling C libs, does not require a C compiler.) > Also devs are used to having named arguments for their functions. Not supporting that is just silly. The latest Perl 5s have this ("signatures"). Signatures are a central element of Perl 6. (They are way more powerful than in Perl 5, even the latest.) > it's difficult to google things like $/, $", $% and $_ when you're confused. Yes. Fwiw Perl 6 only keeps three of these oddly named variables (removing dozens of others) and they are simple in practice: name concept formally means the current/latest $_ it topic (Nil or any value/object) $! oh noes! error (Nil or unthrown exception) $/ /regex/ match (Nil or parse tree)
- cbsmith 11y agoI think you have to squint pretty hard to say that JavaScript, Python, or Ruby are "extremely" similar to Perl. It's really its own, bizarre world.
- deleted 11y ago[deleted]
- hangonhn 11y agoI loved Perl when I first learned it. I loved it for the same reason I love Python now. It's very easy to express ideas I have in mind without worrying about the details. It's a great prototyping (as in prototyping ideas, not as in the type system) language. It was my introduction to "higher level" languages. That said, Perl suffers from having too many magical operators that makes it hard to reason about a snippet of code. I feel Python strikes the right balance. Your comparison to Javascript is apt but I think a lot of us also find Javascript to be a bit of a horror. Recently I learned that Javascript doesn't handle modulus on a negative number correctly among other things.
- deleted 11y ago[deleted]
- raiph 11y ago> [lang X] doesn't handle [basic math] correctly among other things. From a recent talk[1], what are x, y, z in the following? x = 7 ÷ 2; y = -7 ÷ 2; z = .1 + .2 - .3 x y z 3.5 -3.5 0 # human 3 ? tiny number # c89; ? depends on compiler 3 -4 tiny number # ruby 3 -4 tiny number # python 2/3 3 -3 0 # bc 3.5 -3.5 tiny number # perl5 3.5 -3.5 0 # perl6 ---- It isn't just basic math. How "long" is the following string? ปฏิบัติจริง 7 characters # human len("ปฏิบัติจริง") = 33 # python 2 len("ปฏิบัติจริง") = 11 # python 3 "ปฏิบัติจริง".length = ? # ruby (For Ruby, I've found "the core language does not provide a way to count [human perceived characters]". [3] Is that still correct or out of date?) ---- > Perl suffers from having too many magical operators that makes it hard to reason about a snippet of code. I feel Python strikes the right balance. To quote Larry Wall, "Perl 6 ... has been rethought and rebalanced on every level".[4] It might be interesting for you to pick a couple Perl 5 operators that you consider too magical; then we could look at the merits and demerits of those ops in Perl 5 and their equivalents in Python and Perl 6. > It's very easy to express ideas I have in mind without worrying about the details [of Python, now, and Perl, back in the day] This, of course, has explicitly been a deliberate focus of all the Perls. Part of the point of Perl 6 was to remove the bits in Perl 5 that were problematic (including some "too cute/weird" stuff) and to introduce much nicer higher level abstractions (eg grammars instead of just regexes[5]). ---- I've long encountered vocal folk who underestimate or misunderstand Larry Wall and Perl to an absurd degree. Perl has been focused for over two decades on making it easy to get the right results when doing basic practical things (like integer division and counting characters) and, imo, that ought to be obvious to anyone who looks at the matter carefully. ---- [1] http://www.slideshare.net/Ovid/perl-6-for-mere-mortals http://www.slideshare.net/Ovid/perl-6-for-mere-mortals and https://www.youtube.com/watch?v=lpu-3UF_b48 https://www.youtube.com/watch?v=lpu-3UF_b48 [2] http://www.reddit.com/r/perl/comments/2szv7m/beginner_programmer_here_looking_for_help_for_an/cqzk3hi http://www.reddit.com/r/perl/comments/2szv7m/beginner_progra... [3] http://unicode-programming.readthedocs.org/en/latest/count-characters/ruby/ http://unicode-programming.readthedocs.org/en/latest/count-c... [4] http://www.infoworld.com/article/2882300/perl/perl-creator-larry-wall-rethought-version-6-due-this-year.html http://www.infoworld.com/article/2882300/perl/perl-creator-l... [5] https://github.com/moritz/json/blob/master/lib/JSON/Tiny/Grammar.pm https://github.com/moritz/json/blob/master/lib/JSON/Tiny/Gra...