chapter four

4 Writing Lean code

 

This chapter covers

  • Clarifying intent before implementation
  • Constraining solutions to prevent overproduction
  • Evaluating code based on removability, not cleverness
  • Recognizing hidden costs before they compound
  • Practicing judgment through deliberate reduction

4.1 From code to spec: The evolution of defining intent

4.1.1 The waterfall era: Code is truth

4.1.2 Evolving to shift the source of truth

4.1.3 The AI era: Specs become explicit

4.1.4 Spec first: Define before you build

4.2 Design for deletion

4.2.1 Making code deletable

4.2.2 Designing for intervention: Enabling the software Andon

4.3 Managing dependencies and their hidden costs

4.3.1 The value of dependencies

4.3.2 Surface area

4.3.3 AI as a dependency

4.3.4 AI as a dependency generator

4.4 Standard work for coding

4.4.1 To spec or not?

4.4.2 Writing code

4.4.3 The code review

4.5 Exercise: From vibe coding to Lean coding

4.5.1 Start with vibe coding

4.5.2 Write the spec

4.5.3 Compare and contrast

4.5.4 Delete everything not in the spec

4.5.5 Reflect

4.6 Summary