liveBook · Manning

Comfortable layer

As explained in Grokking Simplicity

A stratified-design pattern in which abstraction layers are added and shaped to support programmer productivity and software quality rather than abstraction for its own sake.

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

How Grokking Simplicity covers it

How deep it goes
Defines a practical stopping rule and explains over-abstraction, but stops short of prescribing a fixed layering method.
Examples
Uses JavaScript over machine code and the choice to leave for loops or long arrows unwrapped.
What it assumes
Assumes familiarity with layers and call graphs while relating comfort to abstraction barriers and minimal interfaces.
What you can do after
Evaluate design comfort and apply or defer abstraction work purposefully.
How it connects
Connects stratified design with abstraction barriers, minimal interfaces, straightforward implementations, and call-graph properties.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Grokking Simplicity. The section links point to the parts of the book it draws on.