Abstraction and Modularity
Hiding detail behind clean boundaries lets large systems be understood, built, and changed one piece at a time.
Two Ideas That Tame Complexity
Abstraction is exposing what a component does while hiding how it does it. Modularity is dividing a system into parts with well-defined boundaries so each can be understood on its own. Together they are how humans build systems too large for any one mind to hold in full, by never having to hold it all at once.
Information Hiding
A module presents an interface, the promises it makes, and conceals its implementation, the machinery that keeps them. Callers depend only on the interface. This information hiding means a module's internals can change freely without disturbing anything else, as long as the interface holds. It is the single most important tool for making change safe.
Coupling and Cohesion
- Low coupling: modules depend on each other as little as possible, through narrow interfaces.
- High cohesion: each module does one clearly defined thing.
- Together these let a part be understood, tested, and replaced in isolation.
- High coupling turns a local change into a system-wide hazard.
Leaky Abstractions
No abstraction is perfect; details it tries to hide sometimes leak through, especially performance and failure behavior. A numerical routine may present a clean interface yet expose its inner instability on hard inputs. Good engineering chooses abstractions whose leaks are rare and documents them where they matter, rather than pretending they do not exist.
In Scientific Codes
A physics pipeline is built from modules, an equilibrium solver, a transport model, a heating source, each with a defined interface. Clean boundaries let each be verified independently and swapped as the physics improves, and they localize where errors can hide. The seams between modules, where units and conventions meet, deserve special testing, as coupling always does.