liveBook · Manning

Chapter

As explained in The Art of Code

A chapter is a high-level narrative-code unit that coordinates multiple scenes around a coherent larger goal.

A chapter is a high-level narrative-code unit that coordinates multiple scenes around one coherent larger goal. It advances a broader story arc while allowing more than one aligned plot. section 2.3.4

Figure 2.2 Hierarchical structure of a story
figure

The hierarchy places chapters above scenes and actions, with a table of contents ordering chapters along the full story arc. section 2.3.4

Choose chapter boundaries by balancing:

  • Length: split a chapter when its story becomes tedious, but do not extract code merely to reduce line count. section 2.3.5
  • Responsibility: keep the chapter’s broader responsibility aligned with one goal, while allowing narrower actions and scenes beneath it. section 2.3.4 section 2.3.5
  • Simplicity: extract cognitively heavy conditions or deep nesting into clearly named methods so the chapter remains readable. section 2.3.5

Archiving and delivering

An archiving chapter can express the broader business objective while scenes prepare data and actions perform database operations. A delivering chapter separates preparation from boundary crossing, then brings those scenes together coherently. section 2.3.4

How The Art of Code covers it

How deep it goes
Defines chapter boundaries and supplies length, responsibility, and simplicity criteria for deciding when to split them.
Examples
Uses archiving and delivering stories to distinguish preparation scenes, boundary-crossing scenes, and low-level database actions.
What you can do after
Apply narrative levels to split code into readable chapters, scenes, and actions without increasing cognitive load.
How it connects
Connects chapters with actions, scenes, tables of contents, narrative code, and the Single Responsibility Principle.

Related concepts

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