Under the present invention source code can be shared among nodes in a
peer-to-peer network. Specifically, source code to be shared will first
be analyzed to identify a set of code patterns, assigned one or more
predetermined categories based on the set of code patterns, and then
selectively indexed. A developer desiring to use previously created
source code when creating a new program can perform a context dependent
search based on his/her working code to identify and retrieve relevant
source code.