- Author
- Sandi Metz
- Published
- 20 January 2016
- Kind
- Personal blog essay, republished from a newsletter
- Original
- sandimetz.com/blog/2016/1/20/the-wrong-abstraction
- Subject
- Software design
What it is
Sandi Metz is a software author who sells books and courses. The post was written for a newsletter and republished on a blog. It expands a line from a RailsConf 2014 talk.
What it says
- Metz asserts that duplication is far cheaper than the wrong abstraction.
- Abstractions decay as later programmers add parameters and conditionals to shared code.
- Sunk cost makes people keep tangled code because it looks like costly effort.
- The remedy is to inline the abstraction into each caller and delete unused parts.
- Passing parameters and adding conditional paths signals that the abstraction is wrong.
- After inlining, the code can show which abstractions fit current requirements.
What evidence it gives
The post gives a stylized sequence of Programmer A, Programmer B and Programmer X. The author says it is a pattern seen after asking questions. It adds that the author has seen teams recover by inlining. It gives no counts or cases. It quotes one tweet reacting to the talk.
Interests and limits
The post is a short opinion piece from an author who sells books and courses. It shows no data or named project. It says only briefly that a few conditionals can sometimes help.