2.1.1Thinking abstractly +2.1.2 Thinking ahead Flashcards
Abstraction
Hiding unnecessary detail and showing details that are important in context.
Inputs
What the system needs to process.
Outputs
What the system should produce.
Preconditions
Conditions that already exist and could affect how you devise a solution to a problem.
Subroutines, Procedures, functions and methods
Blocks of code that perform a task and can be reused multiple times.
Caching
Storing instructions or values in cache memory after they have been used, as they
may be used again. Results in faster retrieval times, as instructions or data don’t need to be fetched from secondary storage, which is much slower.
Prefetching
Data being requested from main memory by the processor before it is required.
Procedural abstraction
The process of breaking down problems into smaller more manageable steps
Data abstraction
a form of abstraction in which details about how data is being stored are hidden
Functional abstraction
the implementation detail of the computational method is hidden
Problem abstraction
the process of filtering out - ignoring - the characteristics of problems that are not needed in order to concentrate on those that are needed
The difference between abstraction and reality
● Abstraction is a simplified representation of reality
● Real-world values can be stored as variables and constants
● Objects in object-oriented programming are an abstraction for real-world entities
○ Attributes represent the characteristics of an object
○ Methods represent the actions a real-world object is able to perform
2 advantages of abstraction
-easier for programmers to focus on the core elements
-reduces the time needed to be spent on the project
-prevents programs from getting unnecessarily large
what is representational abstraction
a technique in which excessive details are removed to arrive at a representation of a problem that consists of only the key features.
what form of abstraction involves grouping together similarities within a problem to identify what kind of problem it is
abstraction by generalisation