Some years ago I was told about a study into code reuse. Apparently it was found that, on average, programmers have a 7 minute window when searching for code to reuse. If they don't find code that suits their needs within that window they'll write their own.
This was presented in the context of needing to carefully manage your code for reuse to ensure that you can find what you need within the window.
How do you (individuals and organisations) manage your source to make it easier to reuse? Do you specifically maintain a reuse library? And if so, how do you index it to maximise your hit rate?
Function calls are another way of reusing the code from various parts of your application. You create small code blocks of an algorithm or logic-based source code and provide it a name, identifier. That identifies your code and can describe the process too.
Businesses need rapid app development since they wish to keep up with their competitors and gain the "early-bird advantage" in the market. Using code reuse allows programmers to reuse the same code for similar features in multiple apps, reducing the time it takes to develop new applications.
A complex question:
Some parts of the code can be generalized as libraries or APIs. We have a common library which is kept up to date with solutions to common problems. Typically: validation, caching, data access classes, logging, etc...
Some parts are application specific. They cannot be generalized easily. We convert them in HowTos and give internal presentations. Code is also recycled by use of an easily browsable SCM (in our case SVN).
We also have tools that generate code that one one hand cannot be recycled, on the other it's always similar (think calling a stored procedure).
Pair programming is also a useful way to spread knowledge of existing solutions. We use that when possible or appropriate.
The last technique is tuition. Each coder has a tutor to refer to. Since the tutors are few, there is a lot of sharing between them and this knowledge can be diffused in a top down manner.
Refactor mercilessly and hope for the best.
Update (4 years later and hopefully wiser)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With