I was surprised my worker was on CPAN for two reasons. First of all, this person really does not like Perl. Second of all, his project is in VB.Net. So why in the world would he be looking at CPAN?
Because if you need to write it, there is a darn good chance someone already wrote it in Perl and put it on CPAN. Apparently, this coworker uses CPAN the way most coders use Google -- as a source for example code.
CPAN is a positively amazing resource for the following reasons:
- CPAN code tends to be of high quality (although it's quite often of dubious usefulness).
- CPAN is beyond comprehensive. As of 9/17/2007: 12,168 modules encompassing a whopping 3,898 MB of code.
- CPAN is a universal resource; everyone who has written enough Perl to put it on a server somewhere will put it on CPAN because everyone else puts their code on CPAN.
- CPAN is simple to use. Not only is the Web site so low tech you cannot get lost on it, but the Perl package itself comes with simple tools to access CPAN.
- CPAN bundles are easy to use and access, regardless of whether you download them, view them on the screen and save the text, or use the Perl CPAN tools.
- CPAN code is self-documenting in the Perl POD format. Say what you will about POD (it has some warts), but it is a good format for libraries since it is built into the library and source code at the same time.
- Perl is an interpreted language so, by their nature, any libraries and modules are open source, editable, and viewable.
- The licensing terms are quite gentle; while each module in CPAN has its own license agreement, I cannot recall ever seeing one that did not seem to say, "do what you want, I don't care."
That is enough plumping of CPAN for Perl code for the time being. I must admit -- it has been some time since I visited CPAN. Then again, it has been some time since I wrote Perl that was complicated enough to need to go beyond the built-in modules.
The whole experience with my coworker made me ask myself: Why is Perl completely unique as a once mainstream (and still not obscure) language in having something like a CPAN? Sun never gathered mass with Java as a locus for community content for a huge number of reasons. PHP could have/should have been able to reach CPAN status with PECL and PEAR, but it is nowhere close to CPAN in any respect. Microsoft has made a few attempts with GotDotNet (which is currently being dismembered) and more recently CodePlex.
What did CPAN accomplish that no one else did?
I have no answer to that question. I know that of all of the systems out there, CPAN feels the least professional. The site is probably running on 10-year-old CGI code. The site itself has not been updated in more than five years with the exception of the contents. As far as I can tell, there is no corporate sponsorship of any kind. It does not support "workspaces" or "projects" in any way. There is not a drop of advertising on it other than a tiny logo and a link to the company doing the hosting. In a nutshell, it is like an FTP site with a rudimentary search engine on top of it. At the end of the day, CPAN is something that simply "just happened" without any conscious thought or decision. The more that big sponsors try to replicate CPAN or (even worse) to foster "community," the more they seem to fail.
CPAN is probably one of the top five reasons I miss working in Perl on a regular basis; the lack of an equivalent is one reason why I will never quite adjust to the .Net ecosystem or take a shine to it the way I did Perl. I could spend hours going through CPAN, finding obscure pieces of code (Klingon language parsers, anyone?), reading through them, and learning a lot. Most of the open source stuff out there comprises an entire project, and it is both too large to make much sense from and too broad in scope to learn specific ideas from. For instance, you might need to go through thousands of lines of code that deal with the interface and validation just to find the 100 lines of interesting logic in any given project.
I know... at this point I am Ted, and Perl is Mary; it's years later, and I am still hung up on her. But, in this case, I think there is something really special about the past that no artificial attempts to recreate will ever bring back.
Justin James is the Lead Architect for Conigent.