Skip to content

stevegrossi

simple code

Tended 2 days ago Planted 2 days ago Mentioned 0 times

Contents

Kent Beck’s 4 rules of simple design

As recapped by Fowler, in order of priority:

  1. Passes the tests
  2. Reveals intention
  3. No duplication
  4. Fewest elements

Though there is some controversy over the order of items 2 and 3, which J.B. Rainsberger elucidates.

Simple vs. Easy

  • “Simple” comes from the Latin simplex meaning one part or one fold. Complex, by contrast, means many parts folded or woven together. Simple means keeping things that are different separate, i.e. organized.
  • “Easy” comes from the Latin adjacēns, meaning nearby. Easy means you don’t need to reach far, literally or figuratively, to get it.

Easy is often mistaken for simple, at least in the moment, because when the thing you want right now is nearby it feels like good organization. That is, until you want the next thing.

The Easy Trap

The trap of putting everything you need “at hand,” which eventually makes it harder to find anything in the mess. The solution is hierarchy, a kind of organization, which may put lesser-used things a step or two away but makes the complexity navigable.