返回卡包市场

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

暂无描述。系统推荐的高质量记忆内容,适合每天坚持背诵学习。

卡片总数: 11内容版本: v4公开卡包更新时间: 8/1/2026

卡片预览 (11 张)

#1
正面 (问题)

Thinking ahead

背面 (解答)

• 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

#2
正面 (问题)

Inputs and outputs

背面 (解答)

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, .

#3
正面 (问题)

Specifying preconditions benefits

背面 (解答)

• 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

#4
正面 (问题)

Caching in thinking ahead

背面 (解答)

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

#5
正面 (问题)

pros and cons of caching

背面 (解答)

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

#6
正面 (问题)

Outputs

背面 (解答)

Solution to problem passed back from subroutine

#7
正面 (问题)

Preconditions

背面 (解答)

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

#8
正面 (问题)

arguments

背面 (解答)

the values passed into the parameters of a subroutine

#9
正面 (问题)

prefetching

背面 (解答)

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,

#10
正面 (问题)

reusable program components in thinking ahead

背面 (解答)

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

#11
正面 (问题)

API (application programming interface)

背面 (解答)

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).