Abstraction

Robert Mundinger
CodeParticles
Published in
7 min readOct 22, 2017

“I don’t care how you do it, just do it”

You wake up in the morning. Press the button on your radio, hit the lights, turn the shower handle, make some coffee and then turn the key to fire up the engine to your car. Not very hard.

But think of the years of toil and of genius, the complications and the decades of trial and error that have gone into the invention of the radio, the hot water heater, the toilet, the internal combustion engine. And all you have done is pressed 5 buttons.

This is the essence of abstraction. We understand complex systems only at the level we need to. We are only really aware of the input and output. We turn the shower knob and get hot water. We click a button and music starts playing. No need to understand the underlying mechanisms that actually make these things work.

The last man to know everything is rumored to have lived in the 1700s. Since then, our collective knowledge of the entire world has zoomed far past any one person’s ability to understand it all.

Imagine being sent back in time 2000 years. You could tell them of the wonders of television, airplanes and the internet. But could you tell them how any of it works?

As individuals, we know very little. And yet together we are sitting on thousands of years of collective knowledge

Isaac Newton famously said in 1675 that his great scientific discoveries were due to him “standing on the shoulders of giants” — in other words, his theories and inventions were only possible due to the hard work of other people before him.

Today, we are all potentially standing on the shoulders of others. In the modern world, we are encouraged to specialize and rely heavily on other people. Not only does this allow us to get more done collectively, it keeps the economy going whenever you need a job doing that you can’t achieve yourself, and you call in your plumber, electrician or accountant.

When building a house, the company that adds the shingles to the roof doesn’t need to understand how the foundation was built, it just needs to know about the wood on the roof. Similar to how those that build the frame only need to know about how to interact with the foundation. If I want to operate a car, I don’t need to know the workings on the internal combustion engine, I just need to know where the pedal is.

The roofer doesn’t need to interact with the foundations

Technology

In the same way, technology has levels of complexity. Take the concept of a function. A function is a block of code that does something and returns a result. Imagine that in the code you’re writing, you have to calculate the standard deviation of a set of numbers. This function has been written thousands of times, so there’s absolutely no reason to write it again yourself. We therefore have a shared collection of code that acts as the fundamental building blocks to create more complex programs.

Functions — the building block of programming

Now all you have to do is include this function in your code and ‘pass’ it the numbers you want to get your answer:

CalculateStdDev(mySetOfNumbers)

We can cobble these pieces together and not have to be overwhelmed by complexity.

This is a microcosm of the kind of cooperation our whole society is built on. We don’t have to reinvent the wheel every day, which makes us more productive. We’re allowed to be selectively ignorant which gives us the great productive power of cooperation. This selective ignorance is explained well in The Knowledge Illusion: Why We Never Think Alone. And it’s one of the core concepts in computer science.

Compiler

Writing code requires a programmer to think logically; you have to break down problems to the exact implementation. You can’t say ‘give me a few numbers,’ you have to say ‘give me 5 numbers.’ You can’t say ‘I’ll be there around 5' you have to give an exact time. It requires us to be completely strict in terms of what we want and how we get it.

But at the lowest level of programming (Machine/Assembly Language), this is extraordinarily tedious. If you want to do anything complex you’d have to write thousands of tiny instructions and know where registers are.

This simply isn’t efficient or economical. It would be like speaking to people without being able to use the letter e.

To make this easier on us, we invented ‘high level languages’ which are quite a bit closer to the way humans would write instructions.

In very low level languages (assembly language), you say:

org 100h
mov dx,msg
mov ah,9
int 21h
mov ah,4Ch
int 21h
msg db 'Hello, World!',0Dh,0Ah,'$'

In C (a high level language), you can just say:

print(“Hello World”)

This magic is done by a translator called a compiler. It takes the language and translates it into machine language.

Packages

There is so much packaged code out there on the internet freely available for people to use. Just like you can have an iPhone and plug in thousands of apps to make your life easier, you can find giant libraries of code on the internet to help you write complex programs. If you wanted to build an exact copy of Instagram there is probably a free library that you can use. The code world is built around this concept.

You don’t have to reinvent the wheel and build everything yourself.

There is the Python Standard Library, C Standard Library, .NET Framework all containing thousands of pieces of code available to be used in your program.

Ada Lovelace pioneered this concept in the mid 1800’s — as Walter Isaacson explains in The Innovators:

She envisioned a library of commonly used subroutines, something that her intellectual heirs, including women such as Grace Hopper at Harvard and Kay McNulty and Jean Jennings at the University of Pennsylvania, would create a century later.

In addition there are APIs (Application Programming Interface), SDKs (Software Development Kit), which allow us to use code to interface with other code.

If I want to build an iPhone app, I don’t need to know exactly how the iPhone implements all these things. I just use the Apple iOS SDK to understand how and use the functions they are allowing me to use.

Collaboration

This is what allows for large scale collaboration. Without it, the vast amount of knowledge available would just be overwhelming

It wouldn’t be enough for us to have a large external brain (such as the internet) if we had to what information was available to us and where to find it. But with good retrieval and information storage, we can use the information available effectively and efficiently.

Imagine being sent back in time and told to explain how everything in the modern world works. How much could you actually describe?

We ignore complexity by overestimating how much we know about how things work, by living life in the belief that we know how things work even when we don’t. We tell ourselves that we understand what’s going on, that our opinions are justified by our knowledge, and that our actions are grounded in justified beliefs even though they are not. We tolerate complexity by failing to recognize it. That’s the illusion of understanding. Rather than asking how we tolerate complexity, we’ll ask how we manage it. How can humanity achieve so much when people are so ignorant? It turns out we have been very successful at dividing up our cognitive labor. — Steven Sloman and Philip Fernbach, The Knowledge Illusion: Why We Never Think Alone, 2017

While specializing our knowledge has its benefits, as this quotation suggests, we are easily fooled because we’re not aware of our own ignorance. Fake news takes us in and we believe things that don’t even have a basis in truth, because we trust ourselves to be discerning about what we read when we’re not. As a consequence, the internet is full of people giving opinions on things they don’t really understand.

Will we find a way to combat this? Who knows.

--

--