Author’s note: I’m experimenting with a new writing format, where instead of talking about the inner details of code, I’m going to be writing subjectively about my thoughts on paradigms, ideas and personal learnings in the course of my career. I’m hoping that the most unique thing I can supply is my own viewpoint, flawed and naive as it is, rather than attempting to re-capture something that’s already well-documented in the open web.
I also hope that this way, I can write more fluidly, without needing to fact-check a million things. In theory, this should make it easier to write what I think, and write more frequently.
Hopefully it doesn’t cause a noticeable quality loss.
As kids, my peers really believed abstract art was short-hand for ‘I can’t draw well, so I’m going to throw random things on a canvas and say it’s profound’. I took elementary art subjects, enough that I at least knew what abstract art meant, but not enough that I understood why it existed.
Without delving too deeply into history, it helps to understand the thinking of the era that Abstract Art (in the 19th century) was a near-direct outcome of. At around this time, we had Romanticism (end of the 18th century), which had one of its markers as emotion, creativity and individual expression. Looking at some of the representative works of Romanticism, one sees stark worship of nature itself, as mercurial and untameable as it is, which was a rejection of the previous art era (the ordered philosophies of the Enlightenment). As this idealization of nature progressed, Romantic painters and artists embraced unbounded creative expression, which encouraged more imaginative pieces. This freedom of expression, with less concern for the classical interpretation of things that sit before our eyes, is what led to the Abstract art movement.
As the French painter, Maurice Dennis, said: ““It should be remembered that a picture—before being a war-horse, a nude, or an anecdote of some sort—is essentially a flat surface covered with colours assembled in a certain order.”
Abstract art takes a stab at what makes a thing a thing. It seeks to capture the essence of a thing, whittling away the unnecessary details until what lies in front of us is the purest manifestation of what it means to be that thing.
A very popular example of this is Picasso’s famous bull, a lithograph from 1945 that shows Pablo Picasso making multiple passes over a drawing of a bull until we abstract away the non-essentials, leaving only the ‘bullishness’ of the animal, the minimum viable bull.
As an artistic endeavor, there is something deeply satisfying about such an exploration: it lets you get at the heart of a thing: to separate the concept of a thing from everything else that makes up the thing, but isn’t quite necessary to the essence of the thing.
On software abstraction
Sitting by a beach in Belgrade with my head of engineering, I asked him a question I try to ask as many people as possible. It follows the form of “what is good X?’, where X is the unit of output from your professional discipline. What is good music? What’s a good film? What is a good railroad, a good car, a good phone, a good therapy session, a good executive decision?
I don’t expect to arrive at a unifying theory of goodness by this route, but listening to answers helps me understand what’s considered, even if informally, good heuristics for quality. Here, at the beach, I asked him: ‘what is good code?’
‘There is a lot of contention about that, of course, and some people will even argue that good code is a subjective thing. However, I think that, just as an engineer can tell you what good materials for bridge construction are, we should be able to make assertions about what good code is. We may not, for example, deal with physical raw materials when building software, but time is an essential resource when we’re writing software.
Good code, then, has to yield great software at the shortest time possible. To build complex software systems, we need to have great abstractions at several levels: software that works the way we expect it to, without having to know how it works. It frees up the cognitive overhead of work, gives you a resilient system, and hides away so much schlep.’
‘Consider a door’, he continued. ‘If you find a door, you expect to just turn on the handle, and it opens. If you have to worry about where the hinges go, and if the door lifts from the bottom or the top, or if it swings inwards or outwards, you’re getting into the details of how the door works, and not what the door does (opens and closes). Essentially, the implementation of the door isn’t abstracted away from you, and that makes it a headache to deal with. There’s a lot of code that’s exactly like this.’
(Again, my questions aren’t in search of unifying theories of good code, but understanding what individual people value on a personal level.)
Much like Picasso’s The Bull, there lies, at the heart of the software we use, a version of that thing that’s the essence of the piece of software. Everything else is an implementation detail, and the more we hide away implementation details, the better we get at writing great code that generalizes, and supports higher levels of abstraction overall.
As Edsger W. Dijkstra said, “abstraction is not about vagueness: it’s about being precise at a new semantic level.”
Something I’m learning as I seek to understand computers at any arbitrary level is that the best way to build better models of abstraction is to study as many instances of abstraction as possible, and to ask yourself questions, such as:
This library is elegant. Why?
This library is inelegant and frustrating to use. Why?
What, on this interface, is leaking past its abstraction?
Software design patterns are also a good way to see generalized examples of software abstraction, adopted as a way to processify a common issue.
I’m taking Coursera’s “Building a Computer from First Principles” course in a bid to — along with writing a programming language — understand, even partially, several layers of abstraction that go into the interpretation and execution of computer programs.
Thank you, and that’s all. Enjoy the rest of your day!
Concise writing at an elite level. Superb!
Wow. Just wow. An awesome piece. Thank you