Modularity describes the degree to which a system’s components may be separated and recombined. It refers to both the tightness of coupling between components, and the degree to which the “rules” of the system architecture enable (or prohibit) the mixing and matching of components.
Modular programming is a software design technique that increases the extent to which software is composed of separate, interchangeable components. This is done by breaking down program functions into modules, each of which accomplishes one function and contains everything necessary to accomplish this.
Conceptually, modules represent a separation of concerns, and improve maintainability by enforcing logical boundaries between components.