The Art of Abstraction, in Code

Many people believe in a separation existing between arts and sciences. Science is bound to rules and knowledge while art is limited only by imagination. Most people agree with this idea. However, an artist’s brush is beholden to the same laws as any scientific invention. Meaning that the only true difference between them is the intention brought to different mediums.

A common misunderstanding associated with sciences is that there is one way to do things. It’s simply not true. Much like art, scientific endeavors are completely dependent upon their principle, making any process and result infinitely variable, and arguably, an individualistic pursuit.

The divide between art and science is inherently blurred as a software engineer, being that the code a person writes must be drafted, edited, condensed, re-written, and so forth; much like the work of a novelist.

This leads to a fascinating topic; abstraction. Abstraction has long been a term seemingly owned by the arts. Abstraction lacks detail, science depends. Right?

Being abstract is something profoundly different from being vague…. The purpose of abstraction is not to be vague, but to create a new semantic level in which one can be absolutely precise.

— Edsger Dijkstra

How’s this significant in regards to writing code? Well, a computer interprets code similarly to how a human interprets art — or anything for that matter. The input is simply data, and whether it’s communicated visually, audibly, physically, or as binary are one and the same.

Let’s walk through some examples to best explain.

Apple in 391,868 bytes

The still life painting seen above is not abstract. It is a very literal representation of an apple. It is not actually an apple, because it is a painting–and not actually a painting, because it is a photograph.

The supposed goal of the painting is to make you think, “apple”. It does that very well, but not at all efficiently! The artist spent days laboring over every fine detail. While this does show artistic skill, it exhausts more resources than necessary to convey such a simple message.

If the goal is to communicate apple, how can we do so more precisely?

Apple in 181,330 bytes

[soundcloud url=”″ params=”show_artwork=true” width=”100%” height=”145″ iframe=”true” /]

Press play and listen. What did that sound bite — no pun intended — communicate? A crisp apple being bitten into, perhaps?

Much like the painting, more data (information) is being communicated than we intended in our message, “apple.This means that we are still being inefficient. The audio file is an improvement, but can we do better?

Apple in 13,308 bytes

How about that? The visual abstraction of an apple. The first thought that comes to mind when seeing it is “apple”, though it’s a vector image. The purpose of the vector is to make you think “apple”. It does that very well, and somewhat efficiently!

Fewer resources were exhausted in its making and delivery. However, can we do it better?

Apple in 23 bytes

The fruit of creation.

The short sentence above abstracts exactly what we intend to communicate. It does so extremely efficiently. I’ve included each example’s file-size–determined by my computer — and remember, human memory has limited capacity too!

Notice how the original painted example used 391,868 bytes to communicate “apple.” Through abstraction, we’ve condensed the same message to only 23 bytes. That’s 17,037X improvement!

But, can we do better?

Apple in 6 bytes


“To create a new semantic level in which one can be absolutely precise”, we have developed English, and every other language–spoken or written, computer or human. What you see above is a typed word found in the English language. It is an abstract representation of a real-world object that we interpret and communicate as “apple.” It is as much an apple as is the first example; not an apple at all.

In order to communicate efficiently, we’ve abstracted what we hear, see, feel, smell and think into languages made up of sounds and characters that can form words. Through the sounds and markings we hear, see, and feel (braille), we interpret such inputs into our own languages.

Creating new semantic levels, or developing languages is something humans have forever done and will continue to do. All the beauties in life that have come from languages are incalculable. They bond us.

Computer languages are young. Hearing my father speak of computer engineering in the 1970s, I realize that he learned computer technologies that are the equivalent of paleolithic agricultural tools. He was there in the beginning. Isn’t it spectacular to see such progress in one lifetime? Back then, everything had to be completely explicit, as computer languages we not yet abstracted. They had yet to create new semantic levels!

The computer languages we use today have been achieved through abstraction. Our ability to develop languages through actualizing higher and higher semantic levels, in which we become more and more precise in communicating.

Just like humans have evolved language to abstract millions of bits of data into “apple”, “juicy steak”, orturn leftand interpret such abstractions, so can a computer. The way we choose to use our languages to communicate with computers? Well, that’s up to us.