Great AbstractionWhat makes an abstraction a GreatAbstraction?
I give short explanations in terms of the Unix file system calls.
Pure mathematics is composed almost entirely of examples. (Say, group or topological space. Or even, though this is an informal abstraction only, that of space -- what is it that the ideas of "topological space", "metric space" and "vector space" have in common?)
Within the computing field, the notions of class, list, window, and relational database (picking a few examples from many) are great abstractions of this "informal" kind. Going from "informal" to "formal" generally means providing an API or something similar (a type system, or a set of classes or functions, or whatever). Programming languages at any level above assembler are abstractions. Some of them are great, but I shall avoid saying which ones.
Four dimensional space plus time is without a doubt the greatest abstraction ever devised. Humans learn this abstraction at the toddler stage and humanity first learned it about three thousand years ago. It's such a fantastic abstraction that even blind people can learn it just from their hearing and sense of touch. And without the abstraction of time, it becomes exceedingly difficult to remember the past or plan for the future, though obviously it's doable since humans managed to build civilizations before they invented modern 'extended linear time' as an abstraction.
I wish the first author above hadn't used the Unix filesystem API as an example of a great abstraction, because it's a piss poor abstraction. open() is one of the GrossDeficienciesOfUnix. Great abstractions in computer science include:
Exceptions are mentioned in the list above. Is their absence really a necessary property of an interface which is a GreatAbstraction? In C, any exception-like mechanism is ugly. In other languages (not naming names to avoid looking like a troll), it is not. Perhaps the issue with them is that they supposedly make it difficult to understand a program's behavior? Yet littering code with checks for out-of-band return values and other tests for error conditions obscures the algorithm it implements and is at least as non-ideal as a well-designed exception system. -- DanielKnapp
GreatAbstraction produces ClearEncapsulation.
Which is true when there's something to encapsulate. What does the concept of space encapsulate?
I think a great abstraction hsa something to do with the boundaries of the abstraction. That's the hint which clear encapsulation provides. Some desirable properties in abstractions are,
A GreatAbstraction shouldn't be described in terms of its persistence, but rather in its utility. Persistence and longevity are incidental properties of abstractions, created only by the social environment in which the abstraction proliferates as a meme - you don't need to let anyone else know about a GreatAbstraction for it to be great. Utility for abstractions is more measurable: a GreatAbstraction is readily applied to a wide array of different domains, lacks any properties one should consider 'accidental' or 'arbitrary' or 'unnecessary' (degree of abstraction is ultimately determined by the number of properties abstracted away; you can't abstract away everything or you end up with nothing, but for any property in the GreatAbstraction you ought be able to provide a reasonable explanation as to WHY it is there and WHY it is necessary), and is readily combined (without arbitrary restrictions) with other GreatAbstractions (since any abstraction, by nature, always has variables - those properties that have been abstracted away). As a consequence, any pre-implementation of a GreatAbstraction (with all its open variables ready for injection) should be a great addition to a language library, if not the core language. By observing this fact, one should note that GreatAbstraction should lead you straight to KeyLanguageFeatures
Unfortunately, GreatAbstractions often aren't easy to understand. A lot of people have difficulty with folds, monads, CategoryTheory (abstracting mathematical topologies), homomorphisms, coinductives, etc. The problem seems to be keeping the abstraction in one's head - the lack of details makes them a bit slippery, at least until one possesses considerable experience with their applications. As an example, I've seen some GreatAbstractions in the Boost and Fusion C++ template metaprogramming libraries (including field accessors, field iterators and visitors, expression templates, lambdas, class-independent interface capture, formatters, loop inverters (so you can iterate over a multi-layer for-loop), etc. ... and I can say for certain that many of them truly blow the minds of many traditional C++ programmers (i.e. the vast majority for whom template metaprogramming is weird compiler voodoo magic). That forces me to add addend the above paragraph: GreatAbstractions are excellent to already have in place and accepted by the infrastructure, because they'll fit any problem; but programmers won't be able to learn or use the GreatAbstraction if and until they bump into several problems that require it (i.e. after they've written several specializations, and are then getting ready to refactor). And writing specializations to handle stuff that your old programming language already did perfectly well is, very simply, both irritating and frustrating. Therefore, there had darn well better be some GreatSpecialization?s and GreatDefault?s readily available for day-to-day use; these will avoid frustration for the normal cases AND provide examples of the GreatAbstraction when comes time to use it.
As a final note, your wonderful GreatAbstractions can be a major source of frustration if the infrastructure isn't already there to support it. You can easily wrap anything from the environment or operating system in the GreatAbstraction, but you can't go the other direction. You CantAbstractMuchPastInterfaces; if your GreatAbstraction isn't supported outside the language, you'll be forced to write all sorts of irritating interface code that will only work for some specializations of the GreatAbstraction, just to let you communicate back outwards towards your OS and environment. But LanguageIsAnOs. GreatAbstractions for languages are also GreatAbstractions for OperatingSystems. There isn't any reason NewOsFeatures shouldn't include support for adding arbitrary new GreatAbstractions.
EditText of this page
(last edited May 13, 2008)
or FindPage with title or text search