73 points · by fogus · 13y ago · 88 comments
As I've done for a great many other programming languages, I've bashed on Perl's technical weaknesses at length in the past. To my continued amazement, the Perl folks are the only ones who never get upset. They just say "Haha, yeah, boy, you're right, it sure is ugly. Heh. Yeah, so, um, anyway, I'm going to get back to work now..." It's awesome. I've gained so much respect for them. It's almost enough to make me go back to programming in Perl. Well, almost.
http://steve-yegge.blogspot.com/2006/10/egomania-itself.html
The Comprehensive Perl Archive Network (CPAN) currently has 123,757 Perl modules in 28,037 distributions, written by 10,829 authors, mirrored on 270 servers.
Back in 2004 (almost 10 years; there's been some developments since then) someone ran SLOCCount on all of CPAN, and it estimated the development cost at about $677 million dollars. http://web.archive.org/web/20041010230806/http://www.etla.or...
Before you choose another language for your project, ask yourself if it's not going to cost more to write everything you'll need, or if using pre-existing, time-tested code might do the trick for cheaper.
The one downside about Perl that I think is the most unfortunate is the ninja aspect. You have to be a Perl ninja to write good Perl code. There's no two ways about it. If you come from a different language, you have to ignore all the rules and guidelines you used to develop in, and learn the Perl way, or be ye damned. Which is why most Perl code you've been forced to maintain sucks.
A lot of CPAN's libs are likely cruft from the language being so old, the size of it says nothing. What's more interesting is how often libraries are updated with new code, and how often people use them.
Want to see how old code stacks up in testing? Let's pick a module and see all its dependencies and their test results. XML::Feed as a random example: http://deps.cpantesters.org/?module=XML%3A%3AFeed&perl=lates...
Hmm, says no results for some of them. Let's drill down and select HTTP::Negotiate to see its test results. http://www.cpantesters.org/distro/H/HTTP-Negotiate.html
Looks like the latest version has been tested on lots of platforms, and it's good! Let's pick a different piece of code, something older, say from 2005? https://metacpan.org/release/DOMIZIO/CGI-Builder-CgiAppAPI-1... http://www.cpantesters.org/distro/C/CGI-Builder-CgiAppAPI.ht...
Ah! So we see the last version it worked with and on which platforms, but on the latest perl it's failed its tests. We can drill down and see why the tests failed: http://www.cpantesters.org/cpan/report/c91a8b7c-4983-11e1-94...
Hmm, unprefixed autoloaded parameter. That's probably not too difficult to fix. I guess even though there's old crufty code that isn't always maintained across versions, we have pretty good visibility into when something failed, and with good tests we know why and how to fix it.
There's a lot more resources to take advantage of through CPAN, like bug trackers, review sites, development wikis, etc. http://en.wikipedia.org/wiki/CPAN
A bad sign. This is usually the result of a single test hanging indefinitely, leading to the necessity of killing the entire automated testing process. As a consequence the test results don't get sent to cpantesters.org, putting the onus on the user to file a bug report.
Yes you're right that CPAN has older stuff in it compared to say rubygems.org. It also has, as a gross generalization, older programmers with IMHO more mature and thorough approach to how they package reusable code. This is a language adopted first by graybeard Unix sysadmins in the late 80s and early 90s, then by the first generation of "CGI" web programmers, then by what we'd call today "web developers."
So the fact that CPAN contains old code has tons of upsides because the CULTURE of CPAN was set by more seasoned programmers. The documentation, for example, is of generally much higher quality than in Ruby gems, typically involving a nice Synopsis with lots of pertinent examples, documentation of methods/functions that thoroughly lists params and expected output (imagine that!), and that actually discusses edge cases from time to time. There are usually tests that actually run; by default a CPAN install runs a test suite which must pass before proceeding.
Rubygems are great but unlike CPAN which began as a manual system where adding a module involved dealing with judgmental humans it's all automated, making an account takes a few seconds and there are no real standards. The culture is just different. This has benefits, like lower barrier to entry, but downsides too. I am continually appalled at the level of documentation in common gems. I guess people expect you to just look at the code, as "view source" options abound in online docs, but then you end up chasing a code path through many methods and classes just to figure out the basics. And there are often real issues with the code, too; while Ruby has plenty of users, they are disproportionately Rails devs who stay in that little ecosystem, so a general purpose Ruby module tends to have fewer eyes on it. Don't get me wrong there is lots of high quality amazing stuff in Rubygems and I'm grateful for it, but you can't spend much time on Rubygems and NOT end up seeing a general difference in standards vs CPAN.
Anyway my point is older != cruft and older != bad. Older often means "used by many people for many years, with many bugs removed and many useful features added." Here's one small example. Let's say you want to pull a query param out of an HTTP request. You don't know in advance if it is a GET or POST. In Perl the (c 1994) CGI module solves this trivially without you having to drill down into how the requ was made. In ruby there is no method-neutral way to do this, you have to reinvent the wheel, inspecting the req, sniffing method, and (if you're using any of the code suggestions on Stackoverflow) MANUALLY splitting out the params by decoding the query string and splitting on ampersand. No one has solved this problem with a Ruby module (probably because if you're using Rails, as everyone is, there's a helper for this task).
People call Perl a "read only language" but CPAN's "old" culture makes code re-use more easy than even in a more elegant language like Ruby.
I believe 99.9% of the people will find any libraries they need in pretty much any mainstream language. There is a point where quantity stops being a factor.
It's a framework for writing reactive programs so you don't have to write all the glue normally associated with event-driven apps. It's got 1,044 framework-specific modules to take advantage of (in addition to making it easy to write them yourself).
There's a point where the wheel's already been made and trying to find a better one stops being a factor.
Some of us just want to get shit done and not rewrite the wheel (and debug it).
So there is a 'stability' aspect (which is not changing fundamental things). Perl 6 is having those issues, too much change and its threatening to hemorrhage a bunch of CPAN.
Having been present at the 'birth' of Java and watching the forces at work on it as a language and on it as an environment. I find the forces that change languages interesting. And the question about when to change the language versus when to fork it and make a new language much more complex than I expected.
Frankly, the notion that I need to download an external module in order to do something as basic as finding the largest element of a list seems just bizarre. The real problem here is that instead of having a small orthogonal core that everyone can learn and use, you have an incredibly complicated core that no one really understands that devolves lots of basic functionality to a giant network of modules.
I think the perl community works incredibly hard at writing lots of CPAN modules to try and correct for perl's defects. But 100,000 bandaids isn't something to be proud of.
It should seem bizarre, because no one ever argues that.
I think the perl community works incredibly hard at writing lots of CPAN modules to try and correct for perl's defects.
The module of greatest use to me today allows me to iterate through cells in a spreadsheet. Is it really a defect in a language that something like Spreadsheet::Parse Excel or Apache POI exists?
Second: You don't have to use a module to find the largest element in a list. But you can if you want, and you may find the module does it better than you do. Also, List::Util has been shipped with core perl since 5.8.0, so you don't have to download it.
Third: Perl does have a small core that everyone can learn and use. The fact that you don't understand it or what modules are for does not discredit it.
Have you actually ever looked at Python? The core language is pretty small; much smaller than perl certainly. My point is that if you design the core well enough with orthogonal components and capabilities, you can give people the equivalent of many thousands of purpose-built modules.
I have no idea what you're trying to say with your fruit analogy.
Perl does have a small core that everyone can learn and use.
That hasn't been my experience; the core language seems to have a staggering number of rarely used quite odd features that accumulated early on. It seems extremely hard to write a new implementation of perl that supports all that cruft; one can't even parse perl correctly except by using the existing implementation.
First: Larry is insane. This means more to me than anything in the language itself. I prefer my heroes to have a firm grasp on sanity. I was never a fan of Don Quixote. Larry says God talks to him, and tells him that He hates non-Perl programmers. Larry is a fruit cake, a nut job, crazy as a loon, batty as a belfry.
Having read the interview (http://interviews.slashdot.org/story/02/09/06/1343222/larry-...) I don't see how anyone could come away thinking this. Larry Wall seems like a nice guy to me.Also, this is an old, old rant. It must have been posted multiple times with other URLs.
OK, so he says stuff about his religious views. Not my cup of tea either but he doesn't come off as a jerk about it. And it's fair, IMO, for someone to say their religious views influence their work. That is up to them, their personal opinion. Just because I am not religious myself doesn't mean I have to trash him about it. (Hint: When he says he hears from God, I don't think that's literal.)
I'm wondering if both you and Yegge are misrecognizing some of his sarcasm? (I guess Yegge is probably also exaggerating the personal aspect for comedic effect.)
As cdoxsey says, this as uncharitable, however it's not without a grain of truth. He's a bit of a loon, but a lovable loon.
That being said, what he helped add to the technology ecosystem is as important as GNU/Linux. Perl is remarkably expressive, and I've found in my 18 year IT career that no other single tool has paid me back as much for investing my energy into learning it, both in better "kung fu" (than you Ringo Langly), and also in plain old cash-money.
It's worth adding to your bag of tricks, even if you feel, as the article's author does, that the docs are unwieldy, the community is filled with zealots and cults of personality (to Larry himself, as well as to Merlyn and his ilk), and the syntax is irritating. It's still worth your time. If you invest enough in it to grok the language, you __WILL__ be a better overall developer.
... and unfortunately context sensitivity of operators became much more prevalent in Perl 6 than Perl 5. It was hard to imagine the core Perl maintainers thought that context sensitivity was a feature that needed further enhancement, but that's just what they did in Perl 6.
Programming language design comes down to one word: teamwork. Software is collaborative writing. The better languages allow teams of developers with mixed levels of skill to work together and be productive, to build on each other's code.
Perl 5 had enough quirks and cute context idioms to be clever and interesting, yet it was still possible to decipher what other coders had intended and learn a few new tricks along the way. Perl 6 is a toolkit for outright hostile obfuscation making it damn near impossible for a team of developers to wrap their heads around each others' code. Not surprisingly Perl is fading into the past.
What makes you think so? So far I was convinced of the exact opposite.
Examples:
* Perl 5 has the same operator for bitwise string AND and for bitwise integer AND. Perl 6 has separate operators, reducing context sensitivity.
* Perl 5's reverse() operator reverses lists in list context, and strings in scalar context. Perl 6 has separate verbs for these operations (reverse and flip), thus reducing context sensitivity
* In Perl 5, context flows inwards, so operator can actually be context sensitive in the classical sense. In Perl 6, operators know nothing about their caller, thus they cannot be context sensitive in the same crazy way that some Perl 5 operators are.
I don't know enough about Perl 6 to comment on your opinions of it. I do find it really funny when you condemn a language (Perl) based on a very different language (Perl 6).
I guess you dislike C because C++ is overly complex, too...?
Edit: saraid216, I don't know if you troll or have no clue? Google. Most every source you'll find emphasize that Perl/Perl 6 should be seen as different languages.
Since when does a version increment make it a "very different language"?
How is it comparable between C and C++?
If anything, it's disliking C89 because of C90.
As to its decrease in popularity, I'll point to two factors: (1) the rise of PHP, which took over most of the daily web-based tasks that Perl uses and (2) the rise of frameworks, which meant that people writing web sites were using newer languages so they didn't have to re-roll the basic stuff with each project. Perl didn't compete in that area until much later.
As far as its daily use, I still see it all the time and like many programmers, I implement new Perl code frequently. The flexibility across operating systems is a nice bonus.
For anyone who wants to see Perl written with grace and foresight, try these resources:
I also rather enjoy the excellent career in the bay area that Perl has facilitated.
As I was preparing to leave my last job, I learned Python and Ruby. (I even uploaded a gem for the latter.) I like both of those languages, and I've been toying with them for many years, but my day job has always been Perl.
It didn't seem likely that my next day job would be Perl, at least based on what I keep 'hearing'.
Strangely enough, the perfect position for me turned out to be a bike ride from home. And in Perl.
And I am quite fine with that.
Wait, when did this happen?
Kevin Kelleher suggested an interesting way to compare programming languages: to describe each in terms of the problem it fixes. The surprising thing is how many, and how well, languages can be described this way.
[...]
Perl: Shell scripts/awk/sed are not enough like programming languages.
Python: Perl is a kludge.
Ruby: Perl is a kludge, and Lisp syntax is scary.
Awk is a lovely little programming language... (rather lovelier than Perl if you ask me, though obviously less industrial-strength)
Yes, meanwhile people using Perl succesfully should care, because?
1) He hates Larry, therefore we should all hate Larry's language.
2) He looked in the official detailed technical docs when he was looking for a "learning..." book or a "... for dummies" book. By analogy he was looking for dietel and dietel but when he picked up stroustrop his eyes started burning.
3) He hates the idea that references exist and some people like them and use them. Although you don't have to use them, at all. Also if you insist on implementing your own object oriented design the slow hard way by hand using references instead of "use Moose;" like a normal person, its hard and slow just the way you asked for it, instead of being made impossible.
4) He doesn't like the large number of features. He especially dislikes the single/double character magic variables. Some of them take as much as 30 seconds with google to learn and use!
5) Strange rant about lego as a programming language analogy, which boils down to much like lego, languages should have just a handful of fully understood small pieces that hurt your feet when stepped on barefooted; You must fully understand all (few) language features before programming. I think he's calling for the return of Basic Assembly Language on a S/360 mainframe, or perhaps a more RISC alternative like enterprise grade 6502 machine code.
Its a weird essay. I think its a parody of the recent spat of perl-hate.
If you are a perl programmer, you have to know and use references(pass hash, pass array with other params, nested data structures...). "you don't have to use them" is true in the sense that you don't have to use anything - you don't have to use lists, hashes, OOP, what have you. The same goes for OOP. Moose is an option for new code, not for code which has been written with blessed references.
I don't have anything against references; I do have something against using references and de-references for nested data structures and passing data structures to functions. Yes, I do understand references, but I will take the way Python and Ruby make do without references over Perl's references any day.
Thanks for pointing that out, it is an unfair article because the whole premise of the parody was if the author was running a blue sky startup... so legacy code sucks is not much of an argument.
Some time ago I reflexively converted everything perl OO that I touched to "modern" Moose and it seems to have been worth it. Detection of non-Moose OO should be a Perl::Critic complaint. You can always add something to the exclude= line in a perlcritic.rc file. We've already got Perl::Critic::Tics and ::Lax and a bunch others, so ::FanOfMoose to complain about non-Moose OO is within the realm of possibility.
Rather, he's arguing for a modern Lisp.
I've never stepped on parens while barefoot, though, so I can't speak to whether it'd hurt as much as lego.
Not a particularly enlightening - or for that matter, accurate or representative - opinion piece.
Here he talks a bit about the perl community