What does thinking ahead lets us establish? all of them
Things necessary before starting development of software.
What is an input?
information relevant and necessary for the problem to be solved.
What is an output?
Solution/results to the problem
What are the benefits of identifying inputs?
We can see where the information is coming from, the format it is in, how we can get it where we need it and how to use it for the most optimal solution.
What are the benefits of identifying outputs?
We are able to determine processing stages required to transform inputs into what we want.
What are the possible inputs to a touchscreen navigation system?
Coordinates
Destination
Settings
location (GPS does it automatically)
What are the possible outputs of a touchscreen navigation system?
Map
Directions
Audio
Time and route estimates
What does thinking ahead involve?
Identifying inputs
Identifying outputs
Caching
Identifying reusable program components
What is the concept of caching in thinking ahead?
Using it in order to speed up retrieval of information, it prepares data before it is needed
What is a precondition?
A condition that must be true or correct prior to execution of program/procedure/subprocedure
Why are preconditions added?
To ensure values are initialised correctly, so that program operation is correct and solution operates as expected
What are the advantages of having preconditions?
What is a program library?
series of predefined and compiled routines that are available for use in programs
Why do programmers and companies often use program libraries?
As it is impractical to start everything from scratch. Code will be simpler,easier and quicker to produce,easier to maintain,easier to read and understand.
Give some examples of program libraries
Windows DLL (dynamic link library) Python import modules C Library - using #include
What should we think about when developing a routine in a program?
Whether it can be reused in the same program or be useful in future ones.
What is cache memory?
High performance memory that stores frequently used data and information.
What does implementing cache memory mean?
The rate of execution of programs is very quick. Also it is done automatically by OS.
What are the benefits of having cache memory?
Why is caching in this topic?
It is a prime example of how thinking ahead is implemented into computer science,as data is ready prior to when it is needed.
What can be used with cache memory. What is this process and how does work?
Prefetching , when CPU requests data to be placed in cache before it is necessary
What is a downside of prefetching?
It requires very complex algorithms that determine the likelihood of data to be used in the near future.
What is an upside to prefetching?
Data in cache is more likely to be useful and rate of program execution therefore increases.
What are the drawbacks of cache memory?
- Expensive, increases development costs