Paper 2 Flashcards
Abstraction
: Simplifying a problem by only taking into consideration the necessary details required to obtain a solution, leaving a representation without any unnecessary details.
Graph Theory:
A branch of mathematics that can be used to abstractly represent problems using a collection of nodes connected by edges.
Data abstraction
The storage and representation of data in a computer system along with its logical description and interaction with operators. E.g. Stacks, queues, integers.
Low-level languages
Low-level languages such as assembly code and machine code directly
interact with computer systems but are more difficult to write. Programming using machine code requires having an understanding of the functions specific binary codes perform and although assembly code is easier to memorise, it still requires programmers to know the mnemonics associated with the instruction set specific to the processor.
High-level languages
High-level languages provide an abstraction for the machine code that is in fact executed when a program is run. This makes the process of developing programs easier, as syntax in high-level languages parallels natural language and is considerably easier to learn and use compared to low-level languages. This has also made coding accessible to non-specialists.
The TCP/IP model abstraction
The TCP/IP model is an abstraction for how networks function, separated into four layers of abstraction: application, transport, internet and link. Each layer deals with a different part of the
communication process, and separating these stages out makes them simpler to understand. Each layer does not need to know how other layers work. Outgoing communication is visualised as going down these layers, while incoming information can be imagined as going up these layers. However, it is also important to ensure compatibility between these layers so standards must be agreed in advance. The TCP/IP model uses a set of protocols which means that each layer can be dealt with individually, with details about other layers being hidden. is an abstraction for how networks function, separated into four layers of abstraction: application, transport, internet and link. Each layer deals with a different part of the communication process, and separating these stages out makes them simpler to understand. Each layer does not need to know how other layers work. Outgoing communication is visualised as going down these layers, while incoming information can be imagined as going up these layers. However, it is also important to ensure compatibility between these layers so standards must be agreed in advance. The TCP/IP model uses a set of protocols which
means that each layer can be dealt with individually, with details about other layers being hidden.
Thinking ahead
Designing a solution entails thinking ahead about the different components of a problem and how they will be handled in the best way possible. Thinking ahead allows developers to consider problems or difficulties that may arise when the software is used. Taking these factors into account at an early stage, developers can design strategies to make programs easy and intuitive to use.
Inputs/Outputs
At their core, all computational problems consist of inputs which are processed to produce an output. Inputs include any data that is required to solve the problem, entered into the system by the user. Often, the order in which data is input and the method of input must also be taken into consideration. Outputs are the results that are passed back once the inputs have been processed and the problem solved. Designers must decide on a suitable data type, structure and method to use in order to present the solution, given the scenario.
Preconditions
Preconditions are requirements which must be met before a program can be executed. If the preconditions are not met, the program will fail to execute or return an invalid answer. Specifying preconditions means that a subroutine can safely expect the arguments passed to it to meet certain criteria, as defined by the preconditions. Preconditions can be tested for within the code but are more often included in the documentation accompanying a particular subroutine, library or program.
Caching
Caching is the process of storing instructions or values in cache memory after they have been used, as they may be used again. This saves time which would have been needed to store and retrieve the instructions from secondary storage again. Caching is very common in the storage of web pages. The web pages that a user frequently accesses are cached, so the next time one of these pages is accessed, content can be loaded without any delay. This also means images and text do not have to be downloaded again multiple times, freeing up bandwidth for other tasks on a network.
Reusable Program Components:
Components that have already been written, debugged and tested that can be transplanted into new systems to save development time in project completion.
Thinking procedurally
In computer science, thinking procedurally makes the task of writing a program a lot simpler by breaking a problem down into smaller parts which are easier to understand and consequently, easier to design.
Decision
A decision is a result reached after some consideration.
When solving problems and designing programs, many
decisions have to be made. One of the first and biggest
decisions that is made is choosing the approach or paradigm
used when developing a piece of software. Another example
of decision making within software development is deciding
how different pieces of information are collected.
Concurrent thinking
Concurrent thinking is built upon the idea of concurrent processing. It is the process of completing more than one task at any given time. This doesn’t necessarily mean that you have to be working on multiple tasks at once, which is the technique used by multicore processors. Concurrent processing means different tasks are given slices of processor time, to give the illusion that tasks are being performed simultaneously, and concurrent thinking is the mindset that allows you to spot patterns and parts of problems where concurrency can be applied.
Benefits of concurrent processing
● The number of tasks completed in a given time is increased.
● Less time is wasted waiting for an input or user interaction, as 8other tasks can be completed.
Drawbacks of concurrent processing
● Concurrent processing can take longer to complete when large numbers of users or tasks are involved as processes cannot be completed at once.
● There is an overhead in coordinating and switching between processes, which reduces program throughput.
● Just as with parallel processing, not all tasks are suited to being broken up and performed concurrently.
Concurrent Processing:
Processing where the system appears to perform multiple tasks simultaneously
Branching:
A programming control structure where the code selects one or more alternative paths depending on the evaluation of a Boolean expression.