news.volyx.in

The Wrong Abstraction (2016) (sandimetz.com)

654 points by mkchoi212 · 2282 days ago · 240 comments on HN

Article summary

The article discusses the concept of the 'wrong abstraction' in programming, where an abstraction is created to eliminate duplication but ultimately becomes overly complicated and difficult to maintain. The author argues that in such cases, it's better to reintroduce duplication and start anew, rather than trying to modify the existing abstraction. This approach can lead to simpler and more maintainable code. The author also notes that the presence of existing code can exert a powerful influence, making it harder to abandon it even when it's no longer useful.

Main themes

  • wrong abstraction
  • technical debt
  • code maintainability
  • abstraction vs duplication
  • code complexity
  • software design principles

What commenters say

  • Some developers believe that technical debt includes duplication and wrong abstractions, while others argue that technical debt refers specifically to intentional shortcuts taken to meet short-term goals.
  • Over-engineering and premature abstraction can lead to complex and hard-to-maintain code, and it's often better to wait until a problem has been solved multiple times before abstracting it.
  • The use of abstractions can have both positive and negative effects on code quality, and the key is to find a balance between abstraction and duplication.
  • Excessive abstraction can make code harder to understand and maintain, while a lack of abstraction can lead to duplicated code and make it harder to modify.
  • Some developers argue that code is bad and should be deleted mercilessly, while others believe that good abstractions can simplify conceptual models and make code easier to understand.
  • The effectiveness of abstractions depends on the context and the specific problem being solved, and what works well in one situation may not work well in another.
  • Abstractions can be useful for simplifying complex code and making it more maintainable, but they can also introduce unnecessary complexity and make code harder to understand if not used judiciously.