From: Eric Armstrong Date: 2006-08-13T12:15:02+09:00 Subject: Re: spread your best code-snippets John Gabriele wrote: > > ActiveState does this for a number of languages: > http://aspn.activestate.com/ASPN/Cookbook/ > > The keys to making this work really well, I would think, would be: > > 1. Keep the snippets categorized for easy browsing. > That right there is the really hard part! Everything after that is a piece of cake. The problem is compounded by the fact that a good snippet library nests. One snippet will show basic file reading, another will show a regular expression pattern, and a third will integrate both of them into a snippet that does some useful task. Then there is the synonym issue. Snippets are a great way to answer the "how do I do that?" question, and a snippet library is easily searched when you know the keywords you're looking for. But when you don't know the keywords in advance, the library needs a synonym generation mechanism (so they get included in snippet comments) or a translation mechanism, so people coming from different languages will find the different ways Ruby uses to carry out familiar tasks. It's one /terrific/ AI project. I would think that a paper on "how to do it right" would make a great thesis.