I stumbled on this website while searching for a code snippet and I think it could prove to be a valuable resource, especially to beginning to intermediate perl coders like myself. This site aims to aggregate code samples posted to the web from published books on programming.

The site's "About" page states: "Codefetch's mission is to connect programmers and authors so that programmers get the information they need, and the work of authors is supported and encouraged.....Codefetch uses and supports open source software, and is an affiliate of the Open Technology Business Center. Codefetch's code excerpts connect users of open source software with great books about those software products-- spurring the continuing development of top-quality documentation for open source software." Sounds good to me...

So how do you use the site? According to the help page Codefetch lets you combine three types of searches:

Google-style: Enter words separated by spaces and they'll be found wherever they all appear on a page.
Full-text: Like a text editor, Codefetch can find $, {, % or any other ASCII symbol.
Regular Expression: You can even use a few regular expression constructs.

I decided to test the site by comparing a Super Search on Perlmonks to a Google-style search at Codefetch for the term "LWP::Simple". The results for Super Search can be seen here, and the results of the Codefetch search can be seen here. I think that Codefetch's result compares favorably to Super Search in terms of giving you access to working code and pointers to further explanation. Obviously, if you don't have the book that Codefetch points to, you've got to make a trip to the library or the bookstore or to Amazon. But once you've got the text you are likely to have a carefully edited, tested explanation. With Super Search, of course, you might turn up a question that no one felt like answering:). In any case, this could be a useful spot to point SOPW's to when responding to their questions.

Codefetch also happens to support a large number of other languages in addition to Perl:
C:Cold Fusion:Ant:C#:Flash ActionScript:Apache Configuration
C++:HTML / CSS:AppleScript:Delphi:Pascal Javascript / Ajax SQL
Java:JSP / JSTL / JSF:Unix / Shell:Objective-C Cocoa:Perl
XML-Schema:Python:PHP:XSLT / XPATH:Ruby / Rails

To sum up, Codefetch.com seems to me to be a worthwhile addition to one's bookmark list of programming sites.

Scott
-The quality of an answer depends as much upon the quality of the question as the knowledge and skill of the teacher.
  • Comment on Codefetch.com: Sample code from published programming books

Replies are listed 'Best First'.
Re: Codefetch.com: Sample code from published programming books
by Polonius (Friar) on May 12, 2006 at 12:03 UTC

    Scott,

    I must confess to being slightly uncomfortable with this. Yes, it's a potentially useful resource. Yes, many authors may find it a useful way to showcase their books. But read the "About" page:

    For Authors and Publishers

    Our revenue comes from selling your books. We hope that you are pleased with our efforts, but if you are not, you may request we remove your book from our indices. Please contact author relations at the address below.

    This site appears to be copying substantial chunks of copyright books, then retrospectively offering the authors the opportunity to opt out - no, not even that - to request to opt out. They are doing this for commercial gain. Although some authors will share in that gain, there is no obvious way that their share will be in any way related to the number of people who download their code.

    I've no idea how they do things in Oregon, but in the UK, where I have a passing acquaintance with copyright law (IANAL!), I don't think this site would survive very long.

    Polonius
Re: Codefetch.com: Sample code from published programming books
by spiritway (Vicar) on May 11, 2006 at 18:11 UTC

    This is an interesting approach. I just don't see any real advantage over a properly-phrased Google search; but I guess the references to various books could be helpful.

Re: Codefetch.com: Sample code from published programming books
by samizdat (Vicar) on May 12, 2006 at 12:21 UTC
    It's an interesting idea, and the originator's put a lot of hard work into it, but I think your .sig sums up my opinion of its usefulness. I also can think of lots of concepts that it'd be darn hard to query for without knowing enough regex not to need the site's help. ;-]

    I'm also concerned with copyright issues, as it is clearly exploiting an author's code for commercial gain. If he was able to talk Amazon into adding it to their website, I'd think it'd have a better chance of making it. As it is, it's been out a year and not generated any real buzz.

    Don Wilde
    "There's more than one level to any answer."