2.1.2) Thinking Ahead Flashcards
(11 cards)
Thinking Ahead titles
- Identifying Inputs and Outputs
- Determining Preconditions
- Caching
- Reusable Program components
How do you think ahead?
- Program is decomposed
- I/Os are defined
- preconditions are defined
Why do we identify inputs/outputs?
If not defined explicitly errors and problems can occur.
What are preconditions?
Conditions that must be true for an algorithm to complete successfully.
Where are preconditions stored?
Programmed into code
OR
Supplied in documentation
What are the advantages of determining preconditions?
If preconditions are provided, developer is aware of checks needed
Allows subroutine to be reusable.
What is Caching?
The act of storing data and instructions in registers close to the CPU.
How is caching handled?
Usually automatic by the operating system.
What is Web Caching?
Where HTML pages and images are cached allowing for faster access
When are subroutines put into libraries?
- When they are commonly used
- When developers will make multiple other projects with the same subroutines.
What is the advantage of making reusable program components?
As they have already been thoroughly tested and documented saves time later.