6 ms·
This is my view on Perl after coding occasionally with it for 2-3 years. For the last 6+ months i've been coding Perl 8 hours per day. In general i'd consider m
by buster 15y ago
This is my view on Perl after coding occasionally with it for 2-3 years. For the last 6+ months i've been coding Perl 8 hours per day. In general i'd consider myself at least average in those languages (meaning this list includes my favorite language(s) and ones that i came across for projects and never looked back): C, C++, Java, Javascript, Python, Groovy, Visual Basic, C#, PHP.
To be honest i don't agree at all (actually i'm all for letting Perl die except for little scripts less then 100 loc):
Perl Programmers love their language:
Me (and colleagues) had to use Perl for some projects and i can't say i love the language at all. I understand it, i can write it and i am constantly underwhelmed, disappointed and sometimes disgusted. The point is that Perl is sort of a zombie in many businesses and runs often enough that it can't be ignored and often enough has to be maintained.
True Freedom:
Probably yes, but "and often can find the core developers in charge of some code" really doesn't apply anymore.. i browsed a lot through CPAN and a huge part of modules hasn't been touched for years (i can't count how many modules i've seen from 2001).
Great Community:
I certainly wouldn't bash a whole community, it sure may be great, but when searching online you get the feeling it died years ago (most posts are ooooold). perlmonks.org is often a good resource, but beyond that... the IRC channels i know are more idle then other languages (by far).
CPAN:
True, a big selling point for Perl is the huge amount of libraries on CPAN. But it's really untrue to say "there is nothing like it" (PIP for example).. Same point as above, a big amount of CPAN seems to be not maintained anymore, there are many modules with unsolved bugs.. just a few examples of widely used modules that haven't been updated for years and have open bugs:
Config::Simple https://rt.cpan.org/Public/Dist/Display.html?Name=Config-Simple
XML::Simple https://rt.cpan.org/Public/Dist/Display.html?Name=XML-Simple
HTML::Parser https://rt.cpan.org/Public/Dist/Display.html?Name=HTML-Parser (atleast active)
And i just went through search.cpan.org hit some "buzzwords" and checked the results, there is a BIG amount of modules nobody looked at for years.
I'm not saying that there is no development at all, but often enough i think "mhh, should i even use this module? Nobody seems to care about this anymore". Certainly the most important libraries are actively maintained for sure, no doubt about that!
Awesome Tools:
Yes sure.. Moose is a good example of what's wrong.. it's trying to bring object system to a language that wasn't even remotely designed to support modern language features. Not to bash Moose, i like Moose, it's good! But it tries to solve a problem that shouldn't be there in the first place.
Another creepy example:
Want to have exceptions in Perl? Turns out the language doesn't have them.. There are modules.. all of them do some black magic trying to emulate this. The number one google hit (Error.pm) even states "Using the "Error" module is no longer recommended due to the black-magical nature of its syntactic sugar, which often tends to break.".
And this is not some fancy 2011 language feature, it still isn't built in! What's also not built in? Perl thinks it's ok when you read an uninitialized variable. Want the script to terminate when this happens? You'll have to implement and change signal handlers and take care of it yourself when other modules try the same... ugh..
Want to know if an element is in an array? There are some hideous for loops you could do, but nothing like "if X in Y".. best thing: Most recommended way to do this is to convert your array to a hash/dictionary and check for the key.. that's basic array handling..
I could go on with this list for weeks but i fear this is already too long of a text..
Jobs:
Yes, where i live it doesn't matter. As IT guy it's unbelievable easy to get a job, that has nothing to do with the language. At least where i live.
My criticism on Perl:
- Perl lacks basic language features of a modern language (Exceptions, Array Handling, Error Handling, Unicode Support is horrible and so much more)
- In general Perl code from different programmers looks very different, because basic things can be done equally "well". This and a hideous syntax leads to really hard to read code unless you know every way a Perl program can be written (and i'm sure not even Larry Wall knows that)
My fun fact on Perl:
- Did you know that Parrot (the Perl6 VM) won't have a Perl5 interpreter because it's next to impossible to craft a 100% perl5 compatible parser.. at least they gave up early.
I've had the highest WTF-count while reviewing other peoples code by far(i may at one day put my prime example on thedailywtf.com).
Now this will get me a massive downvote, but this is my Perl experience. I can only beg people:
When your script/tool exceeds 100 lines of code, don't use Perl! Atleast not if there is the remote possibility of another human being having to understand or maintain it. Please!
[edited for some paragraphs, but well... not as readable as i'd like it to be, sorry!]
- chaostheory 15y agoNot sure why you're being downvoted. Your points are valid.
- Mithaldu 15y agoDidn't read all of it yet, but one thing i can answer right now: The modules you mentioned have been superceded by better ones like XML::Twig, Config::INI::Reader/Writer and HTML::Treebuilder (and likely a lot more that i don't recall presently). Also, those bugs you point at are of medium amount, and not exactly crippling. Similar libraries in other languages likely have similar bugs, but they're less known because there's no unified bug tracker. > Unicode Support is horrible http://www.nntp.perl.org/group/perl.perl5.porters/2011/07/msg175113.html http://www.nntp.perl.org/group/perl.perl5.porters/2011/07/ms... Really now?
- Mithaldu 15y agoOk, more responses: > i can't say i love the language at all That is a sample of one. Try visiting a YAPC and you'll see a sample of 1000+ that is opposite to your's. >> often can find the core developers in charge of some code > i browsed a lot through CPAN and a huge part of modules hasn't been touched for years What you said has nothing to do with what you quoted. CPAN allows you to email those authors and the vast majority will reply happily. And even in cases where they don't, it's easy to go on irc.perl.org and ask around in #perl. > the IRC channels i know are more idle then other languages You're not in the right channels. Try irc.perl.org or #perl on freenode. > it's really untrue to say "there is nothing like it" It is perfectly true. See this post for elaboration: http://hackerne.ws/item?id=3238662 http://hackerne.ws/item?id=3238662 > often enough i think "mhh, should i even use this module? Nobody seems to care about this anymore" Did you try asking around? Look for alternatives? Often that is because the remaining bugs are no dealbreakers (license nitpicks anyone?) or the modules have been determined to be crap (XML::Simple). > But it tries to solve a problem that shouldn't be there in the first place. I fully agree, but quite frankly, if you view this as a downside of Perl then you're just plain being short-sighted. The problem was created over a decade ago, at the conception of Perl 5; yet it is comfortably fixable without even changing core. And additionally, there is active work on fixing this issue in core: https://github.com/stevan/p5-mop https://github.com/stevan/p5-mop > Want to have exceptions in Perl? Turns out the language doesn't have them. Valid complaint. Exception::Class is a good tool for this, but i'd also like to have them in core. So far there has been no concensus on how to do it properly though without breaking backwards compatibility. > The number one google hit Google's search results for Perl are terrible and do not reflect the state of the community. Try searching for exception on CPAN itself. > Perl thinks it's ok when you read an uninitialized variable. Want the script to terminate when this happens? `use warnings FATAL => 'all';` > Want to know if an element is in an array? `my @hits = grep { $_ eq 'dogfood' } @array;` Alternatively: `use List::Util 'first'; my $has_dogfood = first { $_ eq 'dogfood' } @array;` And this is in core. > Unicode Support is horrible I'll have to post this twice because you're so wrong: http://www.nntp.perl.org/group/perl.perl5.porters/2011/07/msg175113.html http://www.nntp.perl.org/group/perl.perl5.porters/2011/07/ms... > My fun fact on Perl: {{citation}} > When your script/tool exceeds 100 lines of code, don't use Perl! Atleast not if there is the remote possibility of another human being having to understand or maintain it. Please! Well how nice to show at the end at least that you're a troll.