Back to marketplace

2.1.2 Thinking Ahead

No description yet. This curated deck is ready for daily study.

Total cards: 16•Content version: v4•Public deck•Updated: 8/1/2026

Card preview (16)

#1
Front (Question)

What is thinking ahead ?

Back (Answer)

• identifying preconditions of a system ; inputs outputs and reusable components • by thinking ahead, developers can build programs that are easy and intuitive to use

#2
Front (Question)

Inputs - all computational problems consist of inputs which are processed to produce an output

Back (Answer)

• include any data required to solve the problem • these are entered into the system by the user consider data structure and data types involved

#3
Front (Question)

Outputs

Back (Answer)

• are the results that are passed back • outputs are produced once inputs have been processed / are essentially the solution to the problem

#4
Front (Question)

Example of outputs

Back (Answer)

• visual onscreen information/ printed data • audio • haptic feedback • data to be input into another process or system

#5
Front (Question)

In which order is inputs and outputs determined?

Back (Answer)

• designers begin by considering outputs based on the users requirements • the outputs are then used to identify the inputs required + how they need to be processed to produce the output

#6
Front (Question)

Preconditions

Back (Answer)

• requirements which must be met before the program can be executed • preconditions can be tested for within the code or included In the documentation for a particular library, subroutine or program

#7
Front (Question)

Preconditions benefits

Back (Answer)

• including preconditions within documentation reduces the length and complexity of the program and saves time spent on debugging and maintenance • preconditions make subroutines more reusable

#8
Front (Question)

predictions that can be specified in the documentation can include :

Back (Answer)

• requirements for the device specification to be able to run the program • the operating system required to run the program • any necessary additional software is hardware

#9
Front (Question)

Preconditions in subroutines/ programs

Back (Answer)

• the parameter list must not be empty, otherwise index out of bounds error will occur • the data may need to be all of the same data type - otherwise invalid results may be returned or invalid comparisons made • actions need to be validated to ensure that they will not crash the program if erroneous results are returned

#10
Front (Question)

Reusable components

Back (Answer)

• commonly used functions which are packaged into libraries for reuse [1] • Reusable components include : • classes/objects [1] • subroutines eg. Functions and procedures [1] • abstract data structures e.g stacks and queues

#11
Front (Question)

How are reusable components used when developing large programs ?

Back (Answer)

• programmers make use of reusable components when developing large programs by : • designing software that is modular by breaking the problem into smaller manageable modules [1] • examples of modular components include objects and functions [1] • modules/modular components can be imported and reused in new software projects [1] • or modular components can be shared at runtime through program libraries [1]

#12
Front (Question)

Reusable components benefits

Back (Answer)

• modules are reliable and bug free as they have already been thoroughly tested [1] • thus reusing tested modules leads to more reliable programs [1] • utilising reusable modules reduces development time [1] • as the programs can be shorter since the modules do not have to be rewritten + have already been tested [1] • and modules can also be shared [1]

#13
Front (Question)

Caching

Back (Answer)

• storing frequently used data/instructions in cache in case it is needed again [1] • allowing faster access for future use as it saves time of retrieving instructions from secondary storage again [1] • e.g frequently accessed webpages are cached so content can be loaded quicker

#14
Front (Question)

Caching benefits

Back (Answer)

• frequently accessed webpages are cached so content can be loaded quickly and this frees up bandwidth for other tasks on a network e.g any images and text do not need to be downloaded every time the page is visited • caching provides faster data retrieval by storing freq accessed data in the cache for quick access • reduces load on servers and frees up network bandwidth by minimising repetitive data fetching

#15
Front (Question)

Prefetching

Back (Answer)

• when caching algorithms predict which instructions are likely to be soon fetched or required by a program and these instructions/data are loaded and stored in cache • this minimises delays waiting for data or instructions to be fetched from storage • however prefetching is limited by the accuracy of the algorithms used as data stored in cache is not always used

#16
Front (Question)

The size of the cache determines how effective caching is

Back (Answer)

• smaller caches limit how much data can be stored • larger cache takes longer to search