2.1.2 Flashcards
What is the purpose of thinking ahead?
To make programs easy and intuitive for users to use
What things do programmers need to consider when thinking ahead?
- Method of input/output
- Data structures used
- Data types used
- Order of data
What are preconditions?
Requirements which must be met before a program can be executed
Define caching
The process of storing instructions or values in cache memory after they have been used, as they may be used again
How is caching used in storing web pages?
Web pages that a user frequently accesses are cached so the next time one of these pages is accessed, content can be loaded without delay
What are the advantages of caching web pages
- Content can be loaded without delay
- Images and text do not have to be downloaded again multiple times
- Frees bandwidth for other tasks
- Less time spent waiting
An algorithm predicts which instructions are likely to be used soon
Prefetching
Limitations of caching
- Accuracy of the algorithms used
- Effectiveness of the algorithm in managing the cache
- Size of the cache
Advantages of using reusable program components
- More reliable than new components as they have already been tested
- As developing from scratch isn’t necessary it saves time, money and resources
Examples of reusable program components
- Abstract data structures (queues and stacks)
- Classes
- Subroutines