Understanding Abstraction in Computer Science (Part 1)

Glory Katende
Sep 7 · 5 min read
Image for post
Image for post

An overview of abstraction in General.

This article is an introduction to abstraction in general. It has been written for a larger audience and does not require any prior knowledge of computer science. Everyday life examples are used to allow the content to be understandable by as many people as possible.

This isn’t my usual hands-on guide on how to get a specific thing done in web development, it is rather just a presentation of a fascinating concept that provides lots of benefits we’ll explore.

The content presented here applies to several sciences other than software engineering. This being said, fasten your belt and let’s get started.


What is abstraction?

Image for post
Image for post

Abstraction can be defined as the process of hiding the complexity of a system by providing an interface that eases its manipulation.

It is such an important term in the computer world and it applies to many domains of our everyday life.

As an example, the device in your hand uses a form of abstraction. Your interaction with the very complex underlying hardware is eased by the provision of a very intuitive interface comprised of icons, keyboard, touchscreen, mouse…

In fact, in the past, computers were operated through a finite set of commands on a dark and scary screen, Each was assigned to a specific task.
You had to remember the exact command in order to operate your computer.

The veteran among you will remember the MS-DOS command prompt.

Image for post
Image for post

As you can see, this was counter-intuitive to non-technical people and made it hard to get anything done.

The key here to bear in mind is “finite set of commands”. A question arising from this might be:

How can one perform an operation that is not listed in the finite set of instructions available?

Well, this is where composition comes in. The trick is to be able to create a set of atomic commands, which, if composed together, can perform a lot of new operations suited to users’ needs, as unpredictable as they can be.

This would suggest that an infinite amount of problems could be solved by CLEVERLY COMBINING a finite amount of already existing commands.

This is the principle abstraction, it composes the very limited set of available commands to produce more and more complex commands to fit custom use cases.

Assuming that commands offered only the possibility to copy and delete files; moving files would simply be the composition of copying files to the desired location then deleting them from their previous location: two fundamental operations composed to solve a specific problem at a higher level, a higher abstraction.

Remember from the above that interfaces aim at hiding complexity and easing manipulation.

User interfaces with mouse and keyboards saw the light of day to provide an intuitive means of communication between the user and the computer, by providing a layer of abstraction on top of the “scary dark screen” that could only understand textual commands.

A single click over an icon could be in fact equivalent to complex commands you had to perfectly recall from memory.

The whole complexity of the computer was hidden to the user who could now easily interact with visual artifacts.


Simple application in mathematics

The need for multiplication and division needs to be considered, a composition of our finite set of commands (addition & subtraction) is required.

A multiplication becomes nothing more than a set of successive additions; And division, well, a set of successive subtractions.
In this example, multiplication and division are higher abstractions of addition and subtraction respectively.

From this simplified analogy, you could abstract addition and subtraction for something completely different if the need ever arose.

The need for exponentiation arose and the latter was defined as a set of successive multiplications.

From the latter example, we can say that exponentiation is an abstraction of many multiplications which are abstractions of many additions.

Considering abstraction levels as steps of a ladder, we can say that addition comes at the bottom, multiplication in the middle, and exponentiation at the top. These are called levels of abstraction.

Every abstraction aims at hiding the complexity of the set of operations that compose it.

No sane individual would want to perform five to the hundredth power using only a series of raw additions. It would assuredly become non-manageable. We use abstraction to simplify our work. This saves us from the pain of reinventing the wheel.


Illustration

Image for post
Image for post
Dangerous exposed chemicals
Image for post
Image for post
Safe to use, thanks to abstraction

If a discipline, for some reason, wishes to use an operation above exponentiation, it would proceed by building a step above exponentiation which is a step above multiplication, The latter is a step above addition.


In computer science

As a direct consequence, fundamental operations, listed in the finite set of instruction, by their low-level abstraction, have a greater scope of flexibility than higher-level operations.

This principle applies to computer science and every programming language comes with its own level of abstraction.

Higher abstraction can mean lower flexibility and lower abstraction higher flexibility. There are pros and cons with each abstraction level, but when benefits of higher abstraction far outweigh the cost, we abstract!

With the above being said, How does abstraction work in computer science? in programming languages? what set of atomic operations is available?

Well, this is a question for another article.

Found this article interesting? leave a comment and let me know how abstraction applies in your field of study and how you benefit from it.

The Startup

Medium's largest active publication, followed by +706K people. Follow to join our community.

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch

Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore

Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store