Meatspace abstractions

by Jason Swett,

Abstractions are not just for programming. Abstractions are used in “real life” too.

The concept of a “gear” in an automobile transmission is a good example. What we call first gear, second gear, etc. are actually configurations of multiple gears which result in spinning the driveshaft at different speeds. You might call each gear a “driveshaft gear configuration”. But “driveshaft gear configuration” is too much of a mouthful, so we just call it a “gear”.

Most people don’t know how an automobile transmission works. I myself had to watch a YouTube video about transmissions in order to write this post. Thankfully, we don’t have to know how a transmission works in order to drive a car. In the case of a manual transmission, we only have to learn how to operate the clutch and the stick. With an automatic transmission, we don’t even have to do that. The car abstracts away that detail for us.

My point is that there’s no single entity in physical reality called a “gear”. Abstraction is when we replace lower-level ideas with higher-level ideas in order to more easily understand a certain part of the world. In this case we replace the lower-level idea—a configuration of gears—with a higher-level idea which we call a “gear”.

Abstraction can even be applied to natural phenomena. When rain falls heavily from the sky, accompanied by wind and lightning, we call it a storm. Assigning this group of phenomena to a single idea is abstraction because it replaces lower-level ideas with higher-level ones. Abstraction must have been used even by cavemen.

Why am I talking about non-programming abstractions? How does this help us in programming?

By going outside of programming and considering what abstraction is in general, we can get a clearer idea of what abstraction means, why abstraction is useful and when we might want to use it.

To quote Edsger W. Dijkstra, “The purpose of abstracting is not to be vague, but to create a new semantic level in which one can be absolutely precise.” When we talk about first gear, second gear, etc. in a car, we’re not being the least bit vague. The language we’re using is neither too specific nor too general. For a mechanic working on a transmission, it would probably make sense to speak in terms of lower-level details, like actual individual physical gears, but for a driver of a car, the abstraction of “gear” is at a higher level and precisely the right level for its purpose.

Most web applications, unfortunately, leave most of the benefits of abstraction on the table. They expose the finest details of the system’s behavior and leave it to the reader to piece together the higher-level meaning. It doesn’t have to be this way though. By using a bit of imagination, you can replace lower-level ideas with higher-level ideas in order to make your system easier to understand.

Abstraction isn’t just a technical idea to be used once in a while. It should be in our minds at all times. Abstraction is, and has been since ancient times, one of the fundamental tools that humans use to make sense of our world. We programmers should take full advantage of it.

One thought on “Meatspace abstractions

  1. katafrakt

    I’m not sure I would agree with a storm being an example of an abstraction. Abstraction is something we intentionally make (gear is a great example). But with storm it is “just” putting a distinct name to something that already is there. I put “just” in quotes, because even though it’s not an abstraction (IMO), it is equally important phenomenon, if not more important.

    Why do we have distinct words for some things and not for others? In this case it’s probably the case of efficiency of communication – storm is more dangerous and you should react to it differently than to just rain. I think it’s more akin to patterns in software development. Patterns are not something we invent, but rather something we start to find, observe then we decide it’s important enough to give it a distinct name. And then some “code style” some people were using get a completely new life as a named entity.

    Anyway, nice and thought-provoking article.

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *