Slashdot Mirror


The Law of Leaky Abstractions

Joel Spolsky has a nice essay on the leaky abstractions which underlie all high-level programming. Good reading, even for non-programmers.

1 of 437 comments (clear)

  1. Joel is on crack by Hard_Code · · Score: 0, Flamebait

    Abstractions are just that: abstractions. They are not real. They are pretend, they are fantasy, an illusion we create because they are useful. Nobody said they are concrete.

    That abstractions leak are the nature of abstractions. This ludicrousness is exemplified by his last car example. Nobody EXPECTS to not have to pay attention to the road and weather conditions. In fact, I'm not even sure of what he is implying a car is an abstraction.

    Most of his rant is preoccupied with performance. Non-uniform performance is one of the REASONS for abstractions. You don't want your developer doing wonky ad hoc things for performance because 1) it generally leads to code which is harder to maintain 2) it breaks when your fragile silly assumptions are broken. That is the beauty (or utility for the less romantic) and nature of abstractions. They are simply useful constructs.

    His C/C++ comments seem a bit more on topic, because in that case, he is illustrating a broken abstraction. Abstractions whose implementation cannot live up to their specification are, well, broken. There are many things we can't universally abstract. The point of abstraction is to find those essential shared qualities among many different things. This doesn't guarantee that you will expose all qualities (on the contrary, it implies you CANNOT), and doesn't guarantee you can expose idiosynchrasies that you could exploit.

    I'm not sure what Joel's point is. Is it that we should just go back to flipping switches? I don't know about him, but I am typing this into a "string text area" "widget" in a "browser" "window" on my "desktop" and for all of the metaphor shear, it is still a hell of a lot better than flipping switches and turning knobs.

    --

    It's 10 PM. Do you know if you're un-American?