Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

principle-subtract-before-you-add

先减后加

When evolving a system, remove complexity first, then build.

演化系统时,先去掉复杂度,再建设。

Why: Adding to a complex system compounds complexity. Removing first leaves less code, reveals the essential structure, and usually makes the next design obvious. Default to subtraction.

为什么: 往复杂系统上加东西会复合复杂度。先减留下更少代码、露出本质结构,通常下一步设计也就清楚了。默认做减法。

Make simplification a continual investment. Leave the design slightly simpler and more capable behind the same or smaller surface than you found it.

把简化当成持续投入。离开时,设计应比你接手时略更简单、能力更强,公开面相同或更小。

The pattern:

模式:

  • Sequence removal before construction

  • Cut before you polish (get to the minimum before investing in quality)

  • Design for observed usage, not speculative edge cases

  • No speculative validators, parsers, or guards beyond what the spec demands

  • Simplify prompts (remove redundant instructions, excessive templates)

  • When a reference has no novel content, delete it rather than leaving a stub

  • 删除排在建设前面

  • 先砍再抛光(到最小再投资质量)

  • 为观察到的用法设计,不为臆测边界情况

  • 不做规格之外的臆测校验器、解析器或守卫

  • 简化 prompt(去掉冗余指示、过量模板)

  • 引用没有新内容就删,别留空壳