[Tutor] How do you organize code snippets?

Danny Yoo dyoo at hkn.eecs.berkeley.edu
Mon Sep 19 01:11:03 CEST 2005



On Sun, 18 Sep 2005, List wrote:

> The subject pretty much says it. I tend to clip and save snippets from
> various lists for later reference. I save each in a separate text file
> more or less named appropriately (or so I think at the time), but I've
> ended up with a mess of files in a snippets directory and I can't always
> remember what is what. Is there a better way of tracking code snippets?
> Is there a way of naming or organizing snippets that might help? (For
> example, file i/o snippets, text processing snippets, etc.)

Hi Trey,

The Python Cookbook tries to attack this problem,

    http://aspn.activestate.com/ASPN/Python/Cookbook/

and its approach to this has been to put such snippets in a central
database, and to use both categories and a search engine to maintain
order.

If you run across snippets that have come in handy for yourself, it might
be good to put them in the Cookbook.  Using a personal database
application is also practical, but if you can enter them into the Python
Cookbook as well, then others may find them of value.


Best of wishes to you!



More information about the Tutor mailing list