The Law of Leaky Abstractions
Excerpted from Dreaming in Code: Two Dozen Programmers, Three Years, 4,732 Bugs, and One Quest for Transcendent Software , by Scott Rosenberg, to be published by
Crown Books in January 2007.
Software, we've seen, is a thing of layers, with each layer translating information and processes for the layers above and below. At the bottom of this stack of layers sits the machine with its pure binary ones and zeros. At the top are the human beings, building and using these layers. Simonyi's Intentional Software, at heart, simply proposes one more layer between the machine and us.
Software's layers are its essence, and they are what drive progress in the field, but they have a persistent weakness. They leak. For instance, users of many versions of Microsoft Windows are wearily familiar with the phenomenon of the Blue Screen of Death. You are working away inside some software application like a Web browser or Microsoft Word, and suddenly, out of nowhere, your screen turns blue and you see some white text on it that reads something like this:
A fatal exception 0E has occurred at
0167:BFF9DFFF.
The current application will be terminated.
Eyeing the screen's monochrome look and the blockish typeface, veteran users may sense that they have been flung backward in computer time. Some may even understand that the message's alarming reference to a "fatal exception" means that the program has encountered a bug it cannot recover from and has crashed, or that the cryptic hexadecimal (base 16) numbers describe the exact location in the computer's memory where the crash took place. None of the information is of any value to most users. The comfortable, familiar interface of the application they were using has vanished; a deeper layer of abstraction--in this case, the Windows "shell" or lower-level control program--has erupted like a slanted layer of bedrock poking up through more recent geological strata and into the sunlight.
(Perplexing as the Blue Screen of Death is, it actually represented a great advance from earlier versions of Windows since it sometimes allows the user to shut down the offending program and continue working. Before the blue screen, the crash of one Windows program almost always took down the entire machine and all its programs.)
In an essay titled "The Law of Leaky Abstractions," Joel Spolsky wrote, "All non-trivial abstractions, to some degree, are leaky. Abstractions fail. Sometimes a little, sometimes a lot. There's leakage. Things go wrong." For users this means that sometimes your computer behaves in bizarre, perplexing ways, and sometimes you will want to, as Mitch Kapor said in his Software Design Manifesto , throw it out the window. For programmers it means that new tools and ideas that bundle up some bit of low-level computing complexity and package it in a new, easier-to-manipulate abstraction are great, but only until they break. Then all that hidden complexity leaks back into their work. In theory, the handy new top layer allows programmers to forget about the mess below it; in practice, the programmer still needs to understand that mess, because eventually he is going to land in it. Spolsky wrote:
Abstractions do not really simplify our lives as much as they were meant to. ... The law of leaky abstractions means that whenever somebody comes up with a wizzy new code-generation tool that is supposed to make us all ever-so-efficient, you hear a lot of people saying, "Learn how to do it manually first, then use the wizzy tool to save time." Code-generation tools that pretend to abstract out something, like all abstractions, leak, and the only way to deal with the leaks competently is to learn about how the abstractions work and what they are abstracting. So the abstractions save us time working, but they don't save us time learning. ... And all this means that paradoxically, even as we have higher and higher level programming tools with better and better abstractions, becoming a proficient programmer is getting harder and harder.
So even though "the abstractions we've created over the years do allow us to deal with new orders of complexity in software development that we didn't have to deal with ten or fifteen years ago," and even though these tools "let us get a lot of work done incredibly quickly," Spolsky wrote, "suddenly one day we need to figure out a problem where the abstraction leaked, and it takes two weeks."
The Law of Leaky Abstractions explains why so many programmers I've talked to roll their eyes skeptically when they hear descriptions of Intentional Programming or other similar ideas for transcending software's complexity. It's not that they wouldn't welcome taking another step up the abstraction ladder; but they fear that no matter how high they climb on that ladder, they will always have to run up and down it more than they'd like--and the taller it becomes, the longer the trip.
Comments
rajuch on 02/07/2007 at 11:38 AM
1
How does it solve the software updates problem? What would happen, if they need to change some features six month from the installation? Can we put the bench back in the machine to refine the bench, or do we need to start over and pay for full new bench? Many online applications are being updated every other month.
If one needs to build a computer table or wooden cabinet, can he use that bench-making machine? Or does he need to build a new machine for each kind of products? I am not joking. You would agree, if you read the following.
We already invented such machines for building online-GUI-applications. Greatly appreciate your feedback, what you think about our online GUI application making machine. Please review brief overview to our application machine:
http://cbsdf.com/technologies/software-irony.htm
Each ‘Component Factory’ in the left side of the Figure#1 acts as a knob, to refine each part (i.e. a loosely coupled component/AC) in the application (shown right side). Please review the following WebPages, which show that this process builds perfect ‘application machine’ with simple to operate knobs to refine each part. Please review summary at the end to understand why it cost only a fraction to refine the application:
http://cbsdf.com/ps_blog/Minimum-couplings.htm
http://cbsdf.com/ps_blog/super-distribution.htm
P.S: Of course, one must use our highly-flexible online-GUI-API to build the online GUI components. You may see interactive GUI Components, which are built using SVG. We will be building the GUI Classes for XAML/Vista in the future.
http://cbsdf.com/technologies/demo-links/Demo-SVGS/misc-charts.html
More sample links at: http://cbsdf.com/technologies/demo-links/demo-links.htm
One may build his own custom GUI Classes, for example, to build multi-player online games or near real-time modeling of Air-traffic, as explained at:
http://cbsdf.com/Newbies/Flight-main.htm
http://cbsdf.com/misc_docs/online-apps-rock.htm
Best Regards,
Raju
sriramv.iyer on 02/13/2007 at 4:59 AM
1
But this article did rekindle my interest in DSLs. (I use python and not lisp, though)
rubs74 on 02/22/2007 at 5:27 PM
1
Model Driven Architecture also adds a new level of abstracction to software development and I guess that takes the base idea of Intentional Programming as well. There are already tools that work on production. Here there's a tool based on MDA that really allows you to think more about the bussiness logic and less about the complexities of building it, just take a look http://www.care-t.com/
JEfromCanada on 03/09/2007 at 3:10 PM
1
bushka on 03/14/2007 at 5:55 PM
1
oscarbhaskar on 06/13/2007 at 10:11 AM
1
The question now is how do we implement the concept? How do we capture the "Intention"?
I think we are about to see a new dimension in the way software is developed.
enterprise on 06/30/2007 at 2:45 PM
1
By Christmas.
We will make sure the writers of this excellent article know in good time.
In the meantime, if you want to be involved with the fun, get in touch on gedymail@gmail.com
GD
Corbier on 12/25/2007 at 2:02 PM
4
For a quick glance at what a language definition file might look like, check out:
www.ucalc.com/lisp.txt (Lisp)
www.ucalc.com/forth.txt (Forth)
The download includes more files like this, which you can load up into the generic interpreter, at which point it becomes an interpreter for the language you just loaded. (The supplied interpreter demonstrates just one possible kind of interface. You can create your own fancy interface to interpret such code).
uCalc LB is no longer in the idea stage. An actual fully working beta implementation can be downloaded.
I am the author of uCalc Language Builder (as well as uCalc Fast Math Parser), and I am looking for early adopters of the uCalc LB technology. An interactive tutorial that comes with the download can walk you trough the various concepts. Other forms of documentation are also included, as well as an interactive interpreter.
--
Daniel Corbier
www.ucalc.com