Definition
Modular design is the practice of building a system out of independent units — modules — that each have a well-defined responsibility, expose an explicit interface, and can be developed, tested, and replaced without touching the rest of the system. A module hides its internals behind that interface; callers depend on the contract, not the implementation. The system as a whole is then a composition of modules whose interactions follow predictable rules.
The principle predates software. Industrial assembly lines, kit furniture, and shipping containers all express the same idea: standardize the interface, freely vary what plugs into it. In software the unit might be a function, a class, a library, a service, or an OS process — the level changes but the discipline does not.
Why it matters
How it works
A well-designed module has high cohesion (everything inside it works toward a single purpose) and low coupling (its interactions with the outside world flow through a narrow, explicit interface). The interface is the contract: what inputs the module accepts, what outputs it produces, and what side effects it may have. Everything else — data structures, algorithms, helper functions, internal state — is hidden. Callers cannot see those details, so the implementer is free to change them.
The Unix philosophy is the canonical applied example. Each command is a module: it does one thing, takes input on stdin, writes output to stdout, signals failure with an exit code. Because every command honors that interface, any command can be composed with any other through pipes. The result is a system whose total expressive power exceeds the sum of its tools, because the modules combine in ways their authors did not anticipate. Modular design is what makes this kind of emergent composition possible at all — the interface is the substrate of reuse.