Recently in Opinion Category
Perl's big problem is one of perception. The other day, a job candidate asked me "You're moving your web apps from PHP to Perl? Shouldn't it be the other way around?" Why did he think that? The candidate knew no Perl, and only a bit of PHP, so had no technical reason to believe that PHP was better than Perl. So why did he think Perl was subservient to PHP in the web arena?
What I suspect is that Perl is just less visible, and not just in the sense of crap like the TIOBE index where it equates hits for "Foo programming" popularity of the Foo language. I'm talking about in the real way people see the world of programming.
I'm certain that PHP has become a de facto choice for basic web apps because it's just How You Do It these days. You see enough PHP in the context of the web, it starts to sink in.
Why is Ruby on Rails so popular? Is it better than Perl on Catalyst? Or is it just that people hear about Rails more? I suspect the latter, because perception is reality. When people perceive Perl as being dead, or not as powerful as other tools, it might as well be.
There are three goals I'd like to address:
- Perl needs diversity, needs new blood, both in users and community as well as tools.
- Perl needs more active mindshare in the programming world.
- Perl 5 must continue to be seen as a viable language.
The three actions to take: Decentralize, diversify and colonize.
Perl must decentralize
Perl has a great infrastructure. We have the CPAN. We have the various sites of perl.org. We have Perl Mongers and perlmonks, and so on. Unfortunately, we've grown complacent. It's time to start looking elsewhere for infrastructure and community.
Standardization on tools makes sense if the tools are the best possible tools available. In many cases, the infrastructure already in place in the Perl community may not be the best there is.
Is the Mailman installation running on lists.perl.org the best mailing list solution for you when you need to start a mailing list? If not, then consider other options. Starting a list at groups.google.com is trivial, for example.
Is rt.cpan.org the best bug tracking solution for your modules or projects? If not, then look at other options. Many of my modules, such as ack and WWW::Mechanize are hosted at Google Code, where I use the bug tracking system there.
Is use.perl.org the best place to host your blog? Maybe you should post somewhere else. Certainly that was the case with me. I found that use.perl.org wasn't the news site I wanted it to be, so I started Perlbuzz as an alternative, literally doubling the number of news sites devoted to Perl.
Note that "alternative" does not me "replacement". It's possible to have two similar but diferent projects, websites or whatever that both fill a need. If, say, Perlbuzz replaced use.perl.org, we'd still only have one news site, which is no better a situation than we started with.
Some of the alternatives might not be community-based. Google Code, is not run by altruistic volunteers. Commercial interests will usually have more time and money to spend on providing useful infrastructure. That's no knock on the volunteers, but merely taking advantage of what the commercial interest has to offer.
(I know at some point someone will say "At some point decentralization is harmful." I agree, but we're nowhere near that point. Such a problem to have!)
Perl must diversify
The mantra "There's more than one way to do it" is at the core of Perl the language, but this is not always the case in the Perl community. We must always remember the guiding principle of TMTOWTDI.
The first place to diversify is with people. I suspect, but cannot prove, that the Perl community's size is a net loss as time goes by. We must constantly be trying to bring new people into the fold, to take advantage of their innovations, and to make what we do more fun.
Second, we must be willing to launch new projects, even if they're similar to existing projects. It could be a module, or a website, or an entire application. The knee-jerk resistance to diversity often sounds like this:
- "Why do we need Getopt::Whatever, we already have Getopt::Long"
- "Why do we need another templating system?"
- "Why do we need Jifty/Catalyst/whatever? We already have Maypole."
- "Why do we need Perlbuzz, we already have use.perl.org?"
I've never understood this fear. It sounds like the resistance is based on the premise of "I wouldn't want to do that project, so you shouldn't either." It's the refrain of someone with a closed mind, unable or unwilling to imagine what could be. In the case of similar modules, the refrain usually goes "It's too hard to find the module you want anyway," but that's not a problem of the module, but of the way things are found in CPAN itself. (And if you'd like to address that little bit of decentralization, please take a look at my Rethinking CPAN mailing list.)
Ultimately, fear of the new is counter to the principle of TMTOWTDI. Indeed, plurality is at the very heart of open source, and it's additive, not subtractive. Template Toolkit need not take away from Mason. Perlbuzz need not take away from use.perl.org. Perl didn't take away from awk and shell. In any of these cases, if the new solution does take away from another, then the other solution was an inferior one to begin with.
Decentralizing and diversifying do two things. First, it opens our minds to alternatives that we may not have considered. It makes us more likely to find solutions that are better than what we started with. Second, it helps with colonization, the ultimate goal.
Perl must colonize
The other day, Tim O'Reilly posted on his Twitter feed a link to a cool article about life in the universe which mentioned Von Neumann probes, theoretical space craft that can replicate themselves using materials found in their travels. A single probe could travel some distance, replicate a thousand cloned probes, which would then launch in a thousand different directions, repeating the cycle.
That's what we need to do: Colonize the mindshare of the world to let them know that Perl is still viable, and a hell of a lot of fun. These new Perl lovers will spread the love as well, and the cycle will continue. In terms of action, it means simply "helping make more people aware of Perl as a cool & useful language." Fortunately, it's a case where we can think globally and act locally, even passively.
The biggest effect I see you, the reader, as being able to have is by spreading out Perl's web footprint. I want more places for people to find out about Perl, rather than a few big ones.
This colonization approach goes hand-in-hand with decentralization. Take my ack project, for example. ack has a number of footprints out there:
- A project home page, entirely separate from any perl.org or cpan.org infrastructure.
- A Google Code home page with source repository and bug tracker
- The ready-made search.cpan.org page for ack which points to both.
That's three times places for people to stumble across Perl, to see it mentioned. A separate home page also makes it more likely to get linked from somewhere else, as when Daring Fireball linked to ack and thousands of people came to see about ack. That's thousands of people who went and saw "Huh, here's a tool in Perl."
Of course, a few thousand visitors isn't going to change any mindshare. That's why it's not just me that needs to work on this. Fortunately, decentralizing and diversifying makes colonization easy.
Our Google footprint is pretty bad, anyway. When I search for "perl" in Google, the top five hits are:
- perl.org, which is a good base.
- perl.com, O'Reilly's Perl page, also a good base.
- The wikipedia entry for Perl, which certainly isn't much help for a beginner
- www.cpan.org, with its front page that expects that you know what you want.
- An old perl 4 man page from Carnegie-Mellon University
Is this the best impression that we have to give the world?
Adam Kennedy gets it
Adam Kennedy's Strawberry Perl is a marvel of the principles I've talked about. Strawberry decentralizes, as it uses none of the core perl.org infrastructure, and it diversifies and colonizes by giving Windows users an alternative to ActivePerl, which for many users is not robust enough. When people talk about Strawberry Perl, it helps with mindshare as well.
Adam is a great example of someone who has set out to make improvements to a part of Perl, and implemented it without worrying about permission or duplication, helping Perl as a whole along the way. I thank him for it. I suspect his Perl On a Stick project will have similar results.
How you can help?
The strategy of decentralize/diversify/colonize takes actions at all different levels. You don't have to go create your own Perl distribution, or even write any code. Here are some other ideas to get you started.
- Post a Perl-related web page to Digg, reddit or any of the other social bookmarking websites.
- Bring someone new to a Perl Mongers meeting, even if Perl isn't his/her primary language. Especially if it isn't his/her primary language.
- Go to a user group meeting for another language. See what they're talking about. Share the Perl perspective.
- Start a blog outside of the use.perl.org hierarchy. If you already have a u.p.o journal, keep it, and post to both places.
- Start a mailing list related to a project of yours. Host it somewhere like Google Groups. Don't worry that "people won't be able to find it," because the list of groups at lists.perl.org is no model of organization, either. Besides, the only people who know to look at lists.perl.org are the people that already know there are lists at lists.perl.org. They're not who we're after.
- Start an alternative to perlmonks.org. Perlmonks is a fine site, but it's long in the tooth, daunting to newbies, and frustrating to search. Surely there's a different way to have an online Perl forum that is better in many cases.
- Work on a project that helps cross-pollinate Perl to the rest of the world. The Test Anything Protocol is a good example of this.
- Review a book about Perl. Get it posted to Slashdot or another big tech site.
- Write about Perl in your blog. Even if you think it's not interesting to Perl people, that's fine. Someone will want to read it, and you'll spread that mindshare.
- When you talk about Perl, don't be afraid to use the F-word and the L-word: "fun" and "love".
What do you think?
I'd like to hear your ideas. How can we expand Perl's reach? What have you done to help decentralize, diversify and colonize? How can we keep Perl fun and exciting?
Two comments I don't need to hear: "This will never work" and "This is a waste of time." If that's what you have to contribute, trust that I've taken your insight into account already, and save yourself some typing. Alternative courses of action, however, are more than welcome. Also unnecessary: "None of this would be a problem if not for Perl 6."
Acknowledgements
Thanks to a number of people who have helped discuss these ideas with me as I put them together. These include Pete Krawczyk, Jeffrey Thalhammer, Ricard Signes, Liz Cortell, David Hand, Jesse Vincent and Elliot Shank. I'm sure I've forgotten some, so I apologize if I left you off the list.
Jeff Atwood's blog Coding Horror is one of my favorites. Until yesterday, I'd been recommending it unreservedly.
Jeff's made a big stumble, and I hope he corrects it soon, publicly. In his latest article, We Don't Use Software That Costs Money Here, he talks about how the free software alternatives to non-free software are getting better all the time. Unfortunately, he claims that
It's tempting to ascribe this to the "cult of no-pay", programmers and users who simply won't pay for software no matter how good it is, or how inexpensive it may be. These people used to be called pirates. Now they're open source enthusiasts.
He couldn't be more wrong. There is no equating software piracy, the theft and misuse of copyrighted software, with using open source, where the license specifically allows and encourages the redistribution of the software. Piracy violates the terms of the copyright and license. It's possible to do this with open source software as well, by not following the terms of the license.
In fact, there's no difference between open source software creators protecting their freely-licensed software from owners of non-open licensed software, such as the unfairly reviled Metallica, from protecting their works as well. When we applaud the Software Freedom Law Center for suing companies that violate the GPL, we should also recognize that owners of commercial software licenses should enjoy the same rights to protect their licensing terms as well.
I'm urging Jeff Atwood to correct his mistake. Open source software is nothing at all like piracy. Open source is about the license, not the financial cost.
I've started a group, rethinking-cpan, for discussing the ideas I've posted here. -- Andy
Every few months, someone comes up with a modest proposal to improve CPAN and its public face. Usually it'll be about "how to make CPAN easier to search". It may be about adding reviews to search.cpan.org, or reorganizing the categories, or any number of relatively easy-to-implement tasks. It'll be a good idea, but it's focused too tightly.
We don't want to "make CPAN easier to search." What we're really trying to do is help with the selection process. We want to help the user find and select the best tool for the job.
It might involve showing the user the bug queue; or a list of reviews; or an average star rating. But ultimately, the goal is to let any person with a given problem find and select a solution.
"I want to parse XML, what should I use?" is a common question. XML::Parser? XML::Simple? XML::Twig? If "parse XML" really means "find a single tag out of a big order file my boss gave me", the answer might well be a regex, no? Perl's mighty CPAN is both blessing and curse. We have 14,966 distributions as I write this, but people say "I can't find what I want." Searching for "XML" is barely a useful exercise.
Success in the real world
Let's take a look at an example outside of the programming world. In my day job, I work for Follett Library Resources and Book Wholesalers, Inc. We are basically the Amazon.com for the school & public library markets, respectively. The key feature to the website is not ordering, but in helping librarians decide what books they should buy for their libraries. Imagine you have an elementary school library, and $10,000 in book budget for the year. What books do you buy? Our website is geared to making that happen.
Part of this is technical solutions. We have effective keyword searching, so you can search for "horses" and get books about horses. Part of it is filtering, like "I want books for this grade level, and that have been positively reviewed in at least two journals," in addition to plain ol' keyword searching. Part of it is showing book covers, and reprinting reviews from journals. (If anyone's interested in specifics, let me know and I can probably get you some screenshots and/or guest access.)
BWI takes it even farther. There's an entire department called Collection Development where librarians select books, CDs & DVDs to recommend to the librarians. The recommendations could be based on choices made by the CollDev staff directly. They could be compiled from awards lists (Caldecott, Newbery) or state lists (the Texas Bluebonnet Awards, for example). Whatever the source, they help solve the customer's problem of "I need to buy some books, what's good?"
This is no small part of the business. The websites for the two companies are key differentiators in the marketplace. Specifically, they raise the company's level of service from simply providing an item to purchase to actually helping the customer do her/his job. There's no point in providing access to hundreds of thousands of books, CDs and DVDs if the librarian can't decide what to buy. FLR is the #1 vendor in the market, in large part because of the effectiveness of the website.
Relentless focus on finding the right thing
Take a look at the front of the FLR website. As I write this, the page first thing a user sees is "Looking for lists of top titles?" That link leads to a page of lists for users to browse. Award lists, popular series grouped by grade level, top video choices, a list called "Too good to miss," and so on. The entire focus that the user sees is "How can I help you find what you want?"
Compare that with the front page of search.cpan.org. Twenty-six links to the categories that link to modules in the archaic Module List. Go on, tell me what's in "Control Flow Utilities," I dare you. Where do I find my XML modules? Seriously, read through all 26 categories without laughing and/or crying. Where would someone find Template Toolkit? Catalyst? ack? Class::Accessor? That one module that I heard about somewhere that lets me access my Lloyd's bank account programtically?
Even if you can navigate the categories, it hardly matters. Clicking through to the category list leads to a one-line description like "Another way of exporting symbols." Plus, the majority of modules on CPAN are not registered in the Module List. The Module List is an artifact a decade old that has far outlived its original usefulness.
What can we do?
There have been attempts, some implemented, some not, to do many of these things that FLR & BWI do very effectively. We have CPAN ratings and keyword searching, for example. BWI selects lists of top books, and Shlomi Fish has recently suggested having reviews of categories of modules, which sounds like a great idea. I made a very tentative start on this on perl101.org. But it's not enough.
We need to stop thinking tactical ("Let's have reviews") and start thinking ("How do we get the proper modules/solutions in the hands of the users that want them.") Nothing short of a complete overhaul of the front end of the CPAN will make a dent in this problem. We need a revolution, not evolution, to solve the problem.
Tim Bunce has put together a presentation debunking three pervasive myths about Perl:
- Perl is dead
- Perl is hard to read / test / maintain
- Perl 6 is killing Perl 5
Jim Brandt writes in the TPF news blog that the Perl Foundation is helping a court case surrounding the Artistic License. A Java project has adopted the Artistic License and is now in the middle of a legal battle that could be important legal precedent for future cases regarding open source licensing. TPF has helped support an amicus curae brief in the case.
Jim's article notes "the argument [in the case] that there can be no remedy to a copyright holder who chooses not to charge money for their work." It's kind of like how puzzled relatives ask why me work on open source projects if I'm not getting paid to do it, as if it's less worthwhile that there's no money (directly) changing hands. Here, the plaintiffs in the case are trying to make that perception into settled case law. Thanks to TPF for their work here against that happening.
Here in the Perl echo chamber, there's a lot of talk about advocacy and getting people to use Perl and whether Perl is more popular in the job market than PHP, but I think most of that is just wind in sails. We talk and talk and talk but when it gets down to it, people don't use Perl because it's bigger in the job market, or because of a well-argued thread on Slashdot. People use Perl because the power of Perl makes their lives easier.
Back on the 17th, I posted that Perl would be allowed in the Microsoft Scripting Games. Now, I'm no friend of the "scripting" moniker, but I was glad it was allowed in and thought maybe there would be some good visibility for the power of Perl.
Then I saw the results.
Event 2 in the competition was to read in a text file of comma-separated values of ice skating scores, drop the high & low scores from each skater, and show the top three skaters and their average scores. Trivial for Perl, right? The solution that Microsoft posted, however, was effectively a VBScript script translated to a Perl program (by their own admission).
Here's the solution they posted.
%dictionary = ();
open (SkaterScores, "C:\\Scripts\\Skaters.txt");
@arrSkaters = <SkaterScores>;
close (SkaterScores);
foreach $strSkater (@arrSkaters)
{
$intTotal = 0;
@arrScores = split(",",$strSkater);
$strName = @arrScores[0];
@arrScoresOnly = (@arrScores[1],@arrScores[2],
@arrScores[3],@arrScores[4],
@arrScores[5],@arrScores[6],@arrScores[7]);
@arrScoresOnly = sort({$a <=> $b} @arrScoresOnly);
$intTotal = @arrScoresOnly[1] + @arrScoresOnly[2] +
@arrScoresOnly[3] + @arrScoresOnly[4] +
@arrScoresOnly[5];
$dblAverage = $intTotal / 5;
$dictionary{$strName} = $dblAverage;
}
$i = 0;
foreach (sort {$dictionary{$b} <=> $dictionary{$a} }
keys %dictionary)
{
$i++;
print "$_, $dictionary{$_}\n";
if ($i == 3) {exit}
}
Just dreadful. Among the atrocities: Stringing together list elements with plus signs to get a sum; Hardcoded array indexes; Hungarian notation prefixes of variables, in addition to the Perl sigils; breaking out of a loop after three records are shown, rather than starting with a list of the top three. It's just not good idiomatic Perl code.
Perl's arrays and hashes are powerful, and underused here. Perl arrays are treated like C arrays.
In a few minutes, I had put together the following program which is shorter and clearer because it takes advantages of Perl's strengths.
use warnings;
use strict;
my %averages;
open( my $SCORES, '<', 'c:/scripts/skaters.txt' )
or die "Can't open score file: $!\n";
while ( <$SCORES> ) {
chomp;
my ($name,@scores) = split ',';
@scores = sort @scores;
# Drop high & low scores
pop @scores;
shift @scores;
my $total;
$total += $_ for @scores;
$averages{$name} = $total/scalar @scores;
}
close $SCORES;
my @names_by_score =
sort {$averages{$b} <=> $averages{$a}} keys %averages;
for my $name ( @names_by_score[0..2] ) {
print "$name: $averages{$name}\n";
}
(I'll admit I haven't tested it against their sample data because their sample data is only available in a self-extracting .EXE, which is a bummer for us non-Windows folks, no?)
After I wrote my solution, I noticed that they have an Experts Page that includes links to solutions offered by Jan Dubois of ActiveState. No surprise, Jan's solution is exemplary Perl, and I'm glad that Microsoft provides it. My frothing subsided a bit after discovering this.
Rather than arguing with non-Perl people about which language is better, let's show them. Even more, let's show the people who think that Perl is only a scripting language, only for web sites, or can't be deciphered that Perl will make their lives easier if they'd only open their Swiss Army knives beyond the first blade.
When you're releasing a module, please show a sample use or the output somewhere in the documentation so that people like me who are interested in your module can have some idea of what it looks like and how I'd use it.
I take for example this new distro, pfacter, which purports to "Collect and display facts about the system." Sounds great, but how do I use it? I see a little program. Can I see some sample output? Please? There's nothing in the README or any kind of synopsis that shows it.
Of course, I don't mean to pick on this one distro. It's just the one that disappointed me just now and made me post this. It's something that has always frustrated me, especially as I try to find cool new modules to mention here or over in Mechanix.
(No need to point out that I haven't do this for ack myself. It's on my todo. :-) )
Adam Kennedy has written a very thoughtful article on problems he sees coming up in Perl 6 called "The relationship between a language and its toolchain, and why Perl 6 scares the hell out of me." It's well worth reading even if you're not following Perl 6 that much.
The other day I posted a link to an article by Ted Neward called "Can Dynamic Languages Scale?" I thought it was interesting to see that an outsider saw the potential in Parrot, even though it's not at 1.0 yet. As an afterthought, I lamented that he made a dig at Perl at the end, smiley face or not. I meant it to have the same sort of gravity as saying "Aw, shoot, it's raining out." I didn't care that he didn't like Perl, but that he had to take a swipe. It certainly wasn't a big deal.
Apparently his article caused a minor uproar. Neward posted a followup called "So I Don't Like Perl. Sue Me" in response to the Perl folks arguing with his taste in languages. He shouldn't have had to do that.
I don't get Radiohead. It's all ponderous and aimless. I also don't get Phish, Peter Gabriel and/or Genesis, Yo La Tengo or Tori Amos. But so what? It's personal taste. I don't like Java, either, although I haven't written any in the past 10 years. You know why I don't like Java? It just doesn't look like it's any fun. I'm sure people can explain to me why Java is great, but it won't change my mind. And it doesn't need to.
If you really want someone to love Perl, you'll have to show him, not tell him. Show him great code, great projects. Show the doubters that Perl can do amazing things. Action, not words. And if he still doesn't get it, that's OK.
Ted Neward has written an article on the problems of scaling up projects based on dynamic languages:
While a dynamic language will usually take some kind of performance and memory hit when running on top of VMs that were designed for statically-typed languages, work on the DLR and the MLVM, as well as enhancements to the underlying platform that will be more beneficial to these dynamic language scenarios, will reduce that. Parrot may change that in time, but right now it sits at a 0.5 release and doesn't seem to be making huge inroads into reaching a 1.0 release that will be attractive to anyone outside of the "bleeding-edge" crowd.
Alas, he has to end with "Perl just sucks, period." Even as we work forward with Parrot and Perl 6, the continued public perception of Perl doesn't change. :-(