After finishing Brand‘s How Buildings Learn a few weeks ago, I picked up another Brand book: The Clock of the Long Now which discusses (among other things) how one would design a clock intended to keep accurate time for 10,000 years. Chapter 11 lists the key design principles that the clock’s principal designer decided were most important to the clock’s success or failure. The principle that caught my eye was transparency.
(segue from discussion of clock design to software design)
Transparency is the quality of how easy (or hard) it is to understand how a mechanism works. Upon reflection, one of the reasons that I favor the pure Ajax/REST web architecture I described earlier is because it’s easy to mentally separate into three parts (browser, wire, server) and it’s easy to understand how these parts interact (HTTP requests from browser to server via wire; HTTP responses from server to browser via wire). Why is this ability to compartmentalize subsystems desirable? Because it’s easy to debug when something inevitably goes wrong.
But there’s a tension here; abstraction in software is supposed to be a good thing. The pace at which we can develop software has increased substantially for those of us who don’t have to worry about (for instance) pointers, packets, and concurrent access to persistent storage. Yet anyone who’s tried to debug a problem within an überframework will tell you that it’s hard to figure out where the error’s occurring (their code or your code), let alone fix it. This tension was described in Joel Spolsky’s the Law of Leaky Abstractions article. Net: all abstractions are imperfect, and when a mechanism underlying an abstraction fails, it’s difficult to understand and remediate the problem since the abstraction previously allowed you to remain blissfully ignorant of the underlying mechanism.
So from a design point of view, both abstraction and transparency have merit. Abstraction reduces the amount of detail one needs to master in order to accomplish a task or apply a concept. Transparency makes it easy for new team members to understand the flow of the system and allows developers and administrators to quickly track down and resolve problems. So how to find a balance between these two qualities?
I have some not-fully-formed thoughts on this question, so I’ll save them for a later entry, but I’d be happy to hear others’ thoughts in the meantime.
I’ve struggled with this issue too.
I haven’t come to any concrete conclusions either other than to emphasize that abstraction *costs*.
And not only does it cost, but it usually costs *more* than we think it does – because the person designing the abstraction is not the same person who has to invest the effort to learn how the abstraction works later on.
I think this is one of the main reason why the überframeworks fail. When you try to build a framework in a vacuum, separate from a real application that uses the framework, you clearly don’t have a good grasp of the costs of the abstractions you’re creating.
So I think whenever we create new abstractions we need to make sure we have very good reasons for doing so, and that we’re not unwittingly creating more trouble than we’re solving.
[…] Bill Higgins / the tension between transparency and abstraction Are transparency and abstraction necessarily opposed? Abstraction removes details, but what if it hides extraneous details and makes the most important components and flows more obvious? (tags: abstraction transparency rest ajax architecture) […]
[…] Bill Higgins brings up the tension between transparency and abstraction. Abstraction has been beneficial for software development, in fact it is at the heart of the design principles. […]
[…] There’s a phrase from systems engineering that applies here, the principal of least astonishment. When an abstraction fails, a well-designed one will (hopefully) fail in predictable ways. It’s when an abstraction fails and it fails in an unexpected way that we have evidence of a leaky abstraction. Unfortunately, I don’t think this kind of behavior is avoidable, although it is the case that tracing down the roots of such failures and then refactoring the stuff at those roots will generally lead to a better separation of concerns. The problem is, in software, we generally never take the time to do that refactoring, and so we occasionally continue to be astonished at the most inopportune times. (more) Josh: […]
[…] As highlighted by Bill Higgins in his post, both transparency and abstraction have their own merits and compete with each other. Thoughts on balancing between these two in most cases leads us back to the basic principles software engineering. Some aspects that come to my mind are: […]
[…] There’s a comment at the bottom of this article that strikes me as a good example of the circumstances that led to Rails’ ease of use / maintenance: I’ve struggled with this issue too. […]
A critique of Spring…
If you read my blog, you know I’m not a big fan of the Spring framework. Googling around you find very little articles and posts criticizing Spring. Most notable is Crazy Bob’s I Don’t Get Spring weblog. My blogs on…
I think that balance depends on the audience, if customers are clever in subject matter then you can pay more attention to abstraction.