212-thinking-ahead-elements-of-computational-thinking Flashcards

You may prefer our related Brainscape-certified flashcards:
1
Q

Thinking ahead

A
  • how the diff components of problem will be handled in the best way. determine desired output by backtracking to figure out inputs
  • preconditions and caching
  • how will inputs be captured/processed to output
  • identify problems that may arise so developer can design strats at the early stage to make program intuitive
  • identifying reusable program components
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Inputs and outputs

A

info relevant to problem,
- data signals received from an external source
- Input can be manual e.g mouse or automated e.g sensor
- specialised devices: sip/puff switches, foot switches, Braille keyboards for disabilities

  • data signals produced by a system as a result of processing inputs
  • digital data from a computer system into a format that humans can process (sound, images, vibrations)
    • directed into other places e.g users, devices,
      .
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Specifying preconditions benefits

A
  • documented preconditions make well-defined componenets/modules that can be reused (understood behaviour, no ambiguity)
  • cutting out unnecessary checks (clear, necessary, shorter programs -> ezer debug and maintain
  • expected validation
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Caching in thinking ahead

A

anticipiate what the program will need based on preconditions and precache it

last few excecuted instructions of program, result of earlier computation, data used

all stored in memory for quick retrieve

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

pros and cons of caching

A

faster access to resources, save cost use bandwidth, reduce load on web service, speed up process
can be complicated to implement, requires the correct data to be fetched for the next instruction, consistency with source update, larger caches take longer to search

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

Outputs

A

Solution to problem passed back from subroutine

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

Preconditions

A

current state/requirements that must be met for program to run successfully/execute
if not met, will fail to execute or return invalid result
specifiying preconditions means arguments passed in subroutine expected meet criteria
- can be in documentation or tested for within code
- ensure that the necessary checks are carried out before the execution of a subroutine, either by the user or as part of the subroutine. By explicitly ensuring these conditions are met, subroutines are made more reusable

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

arguments

A

the values passed into the parameters of a subroutine

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

prefetching

A

algorithms predict which instructions are likely to be soon fetched, are loaded in cache before fetched/required
less time waiting
predictive logic difficult to implement, accuracy no guarantee, wrong data cached has to be flushed,

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

reusable program components in thinking ahead

A

commonly used functions -> libraries
- more reliable than new as already tested
- saves money time resources
- reduce redundant code
- possible compatibility issues -> need modification (more costly/time)
- External reuse - reselling a component to a third party, developers leveraging the power of other developers’ software

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

API (application programming interface)

A

interface where software system can interact with another.
- standardises how requests and responses should be structured, including data formats (e.g., JSON, XML) and communication protocols (e.g., HTTP, REST).
- defines specific functionalities or services that applications can use through it. This can range from retrieving/accessing data (e.g., weather information, user profiles) to performing actions/methods(e.g., making payments, sending notifications).

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