by Marius Gheorghe
5. June 2007 20:44
All abstractions are leaky. Get used to it.
Had an interesting (and frustrating) conversation with a friend today. He insisted that abstractions are evil pointing at this
Joel Spolsky arcticle. I disagree.
I think abstractions are great. As a programamer that's one of the first things you learn : think abstract. Everything is abstract around you: a programming language is a abstraction ( for instace C# is an abstraction over IL which is an abstraction over asm which is a abstraction over binary code), a compiler for a specific programming language is an abstraction of the implementation of that programming language, a application framework is an abstraction over the Windows Forms /ASP.NET stack which in itself is an abstraction over GDI+/window messages( or HTML/HTTP in case of ASP.NET). HTTP itself is an abstraction over TCP and so on.....
The key things to remember about abstractions are:
- there is no perfect abstraction. EVERY ABSTRACTION IS LEAKY. In fact i would go further and point that there can't be such thing as a PERFECT ABSTRACTION. It's a misnomer.
- it helps a lot to know the underlying thing that is abstracted (for instance i never met anyone that can be a good ASP.NET developer and doesn't know HTML)
- think abstract. The best way to mitigate software complexity is to abstract things.