The module pattern
A module is a standalone software component implementing specific functionalities, and is easily reusable in different applications. It enables modular programming whose goal is to simplify the development, testing, and maintenance of large applications possibly involving many developers. Modules can also be packaged and deployed separately from each other, allowing changes on a particular module to be properly isolated from the rest of the code of an application. Splitting an application in multiple modules has many benefits: in addition to code reusability, it forces us to reason about the architecture of an application and to structure it so that it may result in becoming more understandable for people who aren't familiar with our application's code.
Modules versus namespaces
In the previous section, we introduced namespaces as an approach to organize our code in nested areas. Now, we are talking about modules as another way to organize the code of an application. What...