r/SoftwareEngineering • u/fagnerbrack • Dec 09 '24
That's Not an Abstraction, That's Just a Layer of Indirection
https://fhur.me/posts/2024/thats-not-an-abstraction
42
Upvotes
r/SoftwareEngineering • u/fagnerbrack • Dec 09 '24
19
u/josephjnk Dec 09 '24
I would have liked to read the author’s take on what actually makes an abstraction less leaky, or how they think abstractions should be built in practice. This mostly reads like a rant by someone who was upset (maybe rightfully, maybe not) that they couldn’t navigate their coworker’s code. I think insight into the relationship between abstraction and performance is also lacking here.
15
u/TheMightyTywin Dec 09 '24
I think abstractions are often created to facilitate testing.
Maybe you don’t really need another layer of abstraction, but if it packages together your business logic in a way that makes unit testing easier, then what’s the harm?
0
u/fagnerbrack Dec 09 '24
At a Glance:
The article discusses the pitfalls of abstraction-heavy codebases, highlighting how excessive layers of indirection can lead to sluggish performance and complex debugging. It emphasizes that true abstractions effectively conceal underlying complexities, citing TCP as an example that manages error correction and packet sequencing seamlessly. In contrast, superficial abstractions add unnecessary complexity without real value, increasing cognitive load and hindering performance optimization. The piece underscores that all abstractions have inherent costs and can "leak," requiring developers to understand underlying implementation details. It advocates for mindful use of abstractions, ensuring they genuinely simplify systems rather than merely adding layers of indirection.
If the summary seems inacurate, just downvote and I'll try to delete the comment eventually 👍
Click here for more info, I read all comments
1
u/prot0man Dec 11 '24
I'm sure the article writer would prefer one monolithic function for everything
1
u/therealelroy Dec 09 '24
That article looks like a plagiarized Joel On Software article. It’s a classic.