- [Craig] In this video, we're thinking about the computational thinking concept of abstraction.
(uplifting piano jingle)
Abstraction, along with decomposition and algorithmic thinking, is one of the three principles of computational thinking
which you need to be aware of at GCSE.
Abstraction simply means removing the unnecessary details and including only the relevant details.
In problem-solving, it's a method of computational thinking that focuses on what's important.
There are many examples of abstraction in computer science.
For example, have you ever stopped to think about when you save a file, where it's actually stored on that hard disk?
And how is this data actually being stored and represented in binary?
This level of detail is abstracted for the user because you only need to know how to create, open, move, save and delete files.
You're not at all concerned with where or how they're being stored, and this is an example of abstraction.
To understand abstraction, let's consider the creation of the software for a satellite navigation device.
When designing the user interface, we have to think about
what's important to include in terms of the inputs and in terms of the output map.
We need to think about what to include on that map and what's not important - and therefore, not worth including.
You can see from the illustration that the location of the car and the road layout is important.
But the trees and the buildings in the surrounding countryside are not important.
To show that we're approaching a junction, we want some audio and visual clues
about which direction we should be taking next, and these need to be given in plenty of time.
It's important not to show all the functionality of the device on the screen that's being viewed at once.
When designing the user interface, a number of icons are likely to be used,
and this is another great example of abstraction,
where the images on the icon only need to suggest clearly what the icon is for,
but they don't actually need to be real-world examples of the objects being displayed.
As long as a key looks like a key, it doesn't have to be any particular type of key.
A home icon should usefully look like a house, but there are many different styles and configurations of houses,
so a generic icon that can be easily recognised by the user as a house is really all that's needed.
So, the unnecessary details have been hidden and only the relevant details that make the icon recognisable have been included.
When we write the software for the satellite navigation device,
we need to think about how we're going to store and manipulate the data in the programming language.
Now, the map that was useful to the user isn't useful when we're actually creating the algorithms behind the scenes.
As long as we can represent which roads are connected to which roads and how many miles they are,
then we don't actually need to see the map at all.
So, the data we're left with is abstracted, and we can now store this in an appropriate data structure for our algorithm to manipulate.
When we think about designing the algorithm, we could use a number of techniques,
and one of those is flow charts, a way of representing our algorithm in a visual form
and this is an abstraction of the actual underlying code that we're going to have to eventually write.
And finally, when we actually write our code for our satellite navigation device,
we will probably be including some variables and calculations, and these are abstracted from the programmer.
In this example here, A equals B minus C.
A, B and C are variables.
But these are really just labels for memory locations.
The numbers stored in the variables will actually be stored in binary,
and we don't really know how this calculation is actually being performed by the arithmetic logic unit.
The complexity of the computer system is being abstracted to the programmer.
So in summary, abstraction is really straightforward.
It's just about removing the unnecessary details and including only the relevant details in problem-solving.
(uplifting piano jingle)