3 ms·
It's funny to see Perl on the top of that list. I was a Perl hater for so long that I don't even remember how it started. It probably has to do with the extensi
by pacoverdi 9y ago
It's funny to see Perl on the top of that list. I was a Perl hater for so long that I don't even remember how it started. It probably has to do with the extensive use of symbols (=~, -s, -d, s/ ...) that makes code quite unreadable and the fact that it sometimes feels more like a shell or a UNIX tool than a proper language.
Recently I wrote a program in Perl after more than 20 years and I actually found it quite enjoyable. It's so easy to write scripts with option parsing that do file processing. You can even make them very readable as long as you sprinkle it with some comments alongside the tersest statements :)
But I guess if I had to write or maintain bigger projects in Perl the nightmare would begin.
- gnulinux 9y agoPerl was meant to be used as "better bourne-shell". Why would you make "big projects" in perl?
- rwmj 9y agoOh sweet summer child. You have clearly never worked on a 100,000 line web service written entirely in Perl in 1999.
- gnulinux 9y agoDoesn't matter you cannot hate perl for doing something it's not meant to do. You cannot write Python code for a super performance critical task in a 500KHz microchip and decide that Python is a horrible language. Python is not meant to be used that way. You should use assembly or C. My point is, if you abuse the intent of languages, they all may end up horrible. It's like writing purely functional OOP code in C.
- ivanhoe 9y agoNot really, because "unreadable" is a very subjective metric. When you spend some time with a syntax your brain learns to parse it quickly and effortlessly. Perl's use of $%@ prefixes to mark the type of variable actually makes it easier to understand, once you get used to the syntax.
- pacoverdi 9y ago100% agree. Another factor is that Perl is highly correlated with heavy usage of regular expressions. Those are easy to write but often pretty hard to read whatever the enclosing language (and author) :)
- pmoriarty 9y ago"It probably has to do with the extensive use of symbols (=~, -s, -d, s/ ...) that makes code quite unreadable..." I hope you're not a fan of Haskell, which is so beloved on HN -- as Haskell's use of symbols makes Perl look restrained and moderate in comparison. Also, there are English-language equivalents of a lot of those symbols in Perl (for instance $INPUT_RECORD_SEPARATOR for $/), and Perl programmers are strongly encouraged to use them.[1] [1] - http://real-world-systems.com/docs/perlEnglish.html http://real-world-systems.com/docs/perlEnglish.html
- tome 9y agoI don't really buy this argument that Haskell's symbolic operators make it harder to read than Perl. Haskell has a very precise and simple rule that syntactically delimits operators from non-operators. Furthermore it has the type system to help you infer semantics. AFAIK Perl doesn't have either of these benefits. Granted, there still may be too much of a tendency for Haskellers to use operators, but lack of clarity to Perl level? Come on!
- thekaleb 9y agoI felt the same as you, but lately I've felt an attraction to perl6. Which version did you choose to use?
- pacoverdi 9y agoDidn't really chose. After checking, perl5 is installed on my laptop. I'll admit I'm too newbie to know the differences between versions 5 and 6 :)