Microsoft Office 2000/Visual Basic Programmer's Guide   

Designing Code for Reusability

Once you've mapped out the overall design for your solution, spend some time thinking about how to structure your code within the solution. There's always more than one way to write the code, and with a little additional effort, you can maximize the reusability of your code. The work you do now to make your code reusable can save you and other developers time in the future, when you can reuse code rather than rewrite it. If you write code with the intention of reusing it in other scenarios, your code may also be easier to maintain because you'll tend to write smaller, more compact procedures that are simpler to modify.

For more information about effective code design, see Chapter 3, "Writing Solid Code," Chapter 7, "Getting the Most Out of Visual Basic for Applications," Chapter 9, "Custom Classes and Objects," and Chapter 10, "The Windows API and Other Dynamic-Link Libraries."