2.1.1 Thinking abstractly
(a) The nature of abstraction.
Abstraction
• the removal of unnecessary details
• allows programmers to focus on core aspects and requirements of code
Representational abstraction
• simplifying a problem based on what is relevant to the given scenario
Abstraction by generalisation
• grouping together similarities to identify the type of problem
• categorising a problem as a particular type can allow it to be solved by a
common solution
• sections of a problem with similar underlying functionality can be solved with
code that can be reused
Data abstraction
• details about how data is represented are hidden
• allows programmers to use abstract data structures without knowing how they
are implemented (e.g. queues and stacks)
Procedural abstraction
• use of functions in programming without having knowledge of the code used to
implement this functionality
• also used in decomposition
(b) The need for abstraction.
The need for abstraction
• allows non-experts to use a range of systems and models by concealing
information that is too complex or irrelevant to its purpose
Complex problems
• large problems will require multiple levels of abstraction
• highest levels of abstraction are closer to user (e.g. providing an interface to
interact with hardware)
, • lowest levels are responsible for the execution of machine code to perform these
tasks
Software development
• abstraction is best used early on in a project
• removal of irrelevant details prevents programs from becoming unnecessarily
large
• design will be more efficient as only key features are focussed on
• reduces the time needed to be spent on the project
High level languages
• using machine code requires the programmer to know the functions of specific
binary codes to write programs
• as this interacts directly with the computer system
• high level languages provide an abstraction for the machine code that is
executed when the program is run
• syntax of high level languages is closer to natural language than low level
languages making it easier to learn
• this makes programming accessible to non-specialists
Layers of abstraction
• each abstracted layer can be used without having to understand how the other
layers work
Example: networking
• TCP/IP is an abstracted model of how a network functions
• it is split into four layers that each deal with a different part of the
communication process
• standards are used to ensure compatibility between each layer and allow each
layer to be dealt with individually
(c) The differences between an abstraction and reality.
The differences between an abstraction and reality
• abstraction aims to be a simplified representation of reality
• the use of computational structures to represent real-world entities
(a) The nature of abstraction.
Abstraction
• the removal of unnecessary details
• allows programmers to focus on core aspects and requirements of code
Representational abstraction
• simplifying a problem based on what is relevant to the given scenario
Abstraction by generalisation
• grouping together similarities to identify the type of problem
• categorising a problem as a particular type can allow it to be solved by a
common solution
• sections of a problem with similar underlying functionality can be solved with
code that can be reused
Data abstraction
• details about how data is represented are hidden
• allows programmers to use abstract data structures without knowing how they
are implemented (e.g. queues and stacks)
Procedural abstraction
• use of functions in programming without having knowledge of the code used to
implement this functionality
• also used in decomposition
(b) The need for abstraction.
The need for abstraction
• allows non-experts to use a range of systems and models by concealing
information that is too complex or irrelevant to its purpose
Complex problems
• large problems will require multiple levels of abstraction
• highest levels of abstraction are closer to user (e.g. providing an interface to
interact with hardware)
, • lowest levels are responsible for the execution of machine code to perform these
tasks
Software development
• abstraction is best used early on in a project
• removal of irrelevant details prevents programs from becoming unnecessarily
large
• design will be more efficient as only key features are focussed on
• reduces the time needed to be spent on the project
High level languages
• using machine code requires the programmer to know the functions of specific
binary codes to write programs
• as this interacts directly with the computer system
• high level languages provide an abstraction for the machine code that is
executed when the program is run
• syntax of high level languages is closer to natural language than low level
languages making it easier to learn
• this makes programming accessible to non-specialists
Layers of abstraction
• each abstracted layer can be used without having to understand how the other
layers work
Example: networking
• TCP/IP is an abstracted model of how a network functions
• it is split into four layers that each deal with a different part of the
communication process
• standards are used to ensure compatibility between each layer and allow each
layer to be dealt with individually
(c) The differences between an abstraction and reality.
The differences between an abstraction and reality
• abstraction aims to be a simplified representation of reality
• the use of computational structures to represent real-world entities