korrents

korrents · piece

The Wrong Abstraction

Sandi Metz · 20 Jan 2016 · sandimetz.com

4 korrents from this piece

Sandi Metz did not write this page.

Every claim below was made in this piece, quoted word for word and numbered in the order the piece makes them, so you can read it there rather than take our word for it. The sentence above each quote is our reading of the claim, not their wording. Each quote was checked against a stored copy of the page at build time; where the two differ, the quote is the fact.

  1. duplication is far cheaper than the wrong abstraction
  2. Existing code exerts a powerful influence. Its very presence argues that it is both correct and necessary.
  3. If you find yourself passing parameters and adding conditional paths through shared code, the abstraction is incorrect.
  4. Once an abstraction is proved wrong the best strategy is to re-introduce duplication and let it show you what's right.