Module Design

Thinking in terms of API-driven and documentation-driven design will yield more usable modules than not doing so. You might argue that internals are not that important: "as long as the interface holds, we can put anything we want in the mix!". A usable interface is only one side of the equation; it will do little to keep the maintainability of your applications in check. Properly designed module internals help keep our code readable and its intent clear. In this chapter we’ll debate what it takes to write modules with scalability in mind, but without getting too far ahead of our current requirements. We’ll discuss the CRUST constraints in some more depth, and finally elaborate on how to prune modules as they become larger and more complex over time.