Thinking ahead (2.1.2) Flashcards

(12 cards)

1
Q

What is thinking ahead?

A

planning
after abstraction

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Considering outputs - thinking ahead

A

what will it produce?
many solutions will have multiple outputs from a simple value printed in a CLI to to images on a screen or a physical object like a price of printed paper
start by thinking what your solutions needs to do and this will help define your output

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Considering inputs - thinking ahead

A

what does it need in order to do them?
usually decided by backtracking from the outputs
what inputs do i need to create this output?
any information that is required is some sort of input to your solution

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is a precondition?

A

something that either needs to exist before your solution can begin to be devised or something that you need to know before you can develop your solution

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Precondition - thinking ahead

A

likely to be considerations around available hardware software or stakeholder requirements that will affect your project

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is caching?

A

storing frequently required information in cache in order to improve performance of a program

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is prefetching?

A

predicting that information will be needed in future and fetching it into the cache before it is needed

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Caching and prefetching

A

because cache is much closer to the CPU than RAM fetching instructions from cache is much quicker than fetching from RAM this means if instructions are required repeatedly then the program can respond much quicker
complicated processes to code into a program and require a great deal of detailed thought to implement effectively

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Reusable program components

A

thinking ahead to the bit between inputs and outputs : processes
processes are often made up of subroutines procedures and functions that have defined tasks
if some of these tasks need to be performed in multiple places within the solution then reusing these subroutines is a good idea

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Why is reusable code good?

A

shortens development code
saves system resources
lowers development costs
reduces redundant code

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What are libraries?

A

collections of reusable code in the form of collections of subroutines which have been collected for specific purposes
e.g pygame tkinter random

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Library benefits

A

already compiled so are tested and error free
no need to re invent code so saves time and money
can reuse as many times as needed
draw on other programmers expertise
standardised approach to coding allow interchangeable practices
reduce the number of developers required
some libraries can be utilised across multiple languages

How well did you know this?
1
Not at all
2
3
4
5
Perfectly