2.1.1 - The nature of abstraction Flashcards
What is abstraction?
Process of removing unnecessary details to simplify a representation
Name three examples of abstraction
London Underground maps
Building plans
Video game
programming languages
How was abstraction applied to modern-day high-level programming languages?
First generation = Programming first started with machine code - 1s and 0s. Tedious and time-consuming.
Second generation = assembly language / mnemonic codes. Complex task and has to be re-written for each piece of hardware.
Third generation = High-level languages such as FORTRAN or BASIC. EG. X = A + 5. Programmers didn’t have to worry about memory allocation etc.
What is abstraction by generalisation?
Abstraction by generalisation is a grouping by common characteristics to arrive at a hierarchical relationship of the “is kind of” type.
For example:
- Object-oriented programming - Animal class has certain attributes that a dog class will inherit - therefore meaning a dog ‘is a kind of’ animal.
- Leonhard Euler - broke down the Konigsberg bridge problem into a problem that ‘is a kind of’ graph theory.
What is data abstraction?
The details of how some data is represented are hidden.
For example:
When programming the programmer is not bothered by how the integer data type is represented within the computer.
Explain abstract data types
Queues; stacks; graphs and trees are all abstract data types.
They have a complicated structure however the programmer is only interested in the functions (AddToQueue etc) of these data structures. They do not need to know how the data structure is implemented, for example, an array with pointers to the front and rear of a queue.