A comfortable layer is an abstraction layer shaped around programmer productivity and software quality. Add structure where it makes the code easier to work in, not merely to increase the number of layers. section 8.4 section 9.13
Use comfort as a practical design test:
- Keep existing code when the team is comfortable with its details and the code feels clean enough. section 9.13
- Return to abstraction barriers, minimal interfaces, or straightforward implementations when details become difficult to hold in mind or the code feels unclean. section 9.13 section 9.14
- Treat tall abstraction towers cautiously: they can hide useful detail, but they may also be incomplete or less convenient than direct code. section 9.13
- Invest in layers that improve delivery speed and quality rather than adding layers for their own sake. section 8.4 section 9.21
A useful abstraction
JavaScript lets programmers work without thinking about machine instructions, although creating such a robust abstraction required substantial long-term effort. In ordinary projects, the comfort test helps decide when a smaller, practical abstraction is sufficient. section 9.13
