in reply to What CPAN Modules are Good to Learn From?
I think it depends very much on what it is you want to learn. How to implement algorithms? How to factor code? How to do OO? How to do good internal documentation? How to make good interfaces? How to create modules specifically?
On at least one of these, I would not recommend CGI... At least, not until you have the experience to understand why it is the way it is. It is surely a wondrous work, but (in the opinions of many, including myself), it tries to do, and be, too many things. For example, it provides both OO and procedural interfaces to all of its functions, and the functions accept both positional and named parameters. Sure, that's "nice to have" from the user's perspective, but is not a "best practice" for module writers; and certainly doesn't make CGI a "good read".
Observe that CPAN listings of modules includes ratings. Unfortunately, none of the usual CPAN search engines provide a way to search or order modules by rating. The site where ratings are entered, CPANratings, doesn't even let you do this. I'm going to try looking at a local mirror of CPAN, maybe do a one-off search for the top-rated modules. But beware that module ratings are an imperfect indicator of quality for your purpose, as they're based at least as much on the usability of the module. But hey, it's a place to start.
On a similar note, there is CPAN Testers. This gives lots of concrete statistics on how well modules pass their test suites, but it seems to be oriented toward answering the question of crossplatformance, i.e. "how well does CPAN — the collection of all current modules — meet the ideal of running on all platforms flawlessly?" To the extent that it lets you compare the results for individual modules, it neither distills it to a single kwalitee metric nor lets you sort by that metric. However, analysis shows the pass/fail numbers; you could easily scrape that page and do the final calculation yourself. But ultimately, this would only give you a hint of how "good" the module is. But at least you could filter out the modules that aren't "good" from a testing and portability perspective.
AnnoCPAN, another star in the CPAN feedback constellation, only lets people add comments; it doesn't provide any kind of qualitative ranking.
Update: Ah, LanX has remindedme of CPANTS, which does (when it's working) let you get a listing of modules ordered by kwalitee metric. But check out their relatively static Hall of Fame: 45 distributions with the most Kwalitee. I chose three modules at random from that list and perused the source code. What I saw was, I think, generally well written, perhaps even exemplary. What I didn't see was much internal documentation.
|
|---|