Create Modules That Have Strong Cohesion

The importance of procedures is usually better understood than that of modules—a procedure is a section of code that performs a unified function. Unfortunately, for many developers the role of the module is a bit more confusing. A module is often wrongly thought of as a mere container used to store procedures. Some developers even take this idea to an extreme and put all their procedures into a single module—ugh!

One reason that modules don’t always get the consideration they require is that the implementation of modules really doesn’t affect the execution of a program. When a project is compiled, it doesn’t matter whether all the procedures are in a single module or in dozens of modules. But while the ...

Get Practical Standards for Microsoft® Visual Basic® .NET, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.