Skip to main content

Do Not Abstract Incidental Similarity

As programmers we love to bring about order, to analyze the situation and notice patterns and similarities. Much power can be derived from noticing and abstracting similarity — your code becomes shorter, easier to read and digest, decluttered, all that good stuff. But you can go too far. Just like complexity, similarity can be inherent or incidental. The former is what you want to abstract. The latter you want to leave alone, lest your abstraction starts getting in your way more than helping you.

Next: Beware of Unnecessary Indirection ⇒

Comments