2.1.2 thinking ahead

Cards (17)

  • thinking ahead
    caching
    does pre-fetching save time?

    yes as instructions have been prepared in advancement
  • thinking ahead
    caching
    what is pre-fetching
    -This is a type of caching where algorithms predict what data will be needed soon and load it in advance.
  • thinking ahead
    caching
    what is the benefits for pre-fetching
    -speeds up programming and reduced delays
    -improves the user experience, even when it comes to repetitive tasks
  • thinking ahead
    caching
    what is the limitation for pre-fetching
    -Pre-fetching relies on prediction which can be wrong at times
    -Larger caches can store more data but takes longer to search (cache size limits how much data can be stored)
    -Effective caching requires smart algorithms, which can be tricky to develop
  • thinking ahead
    caching
    why is this good?
    -This is good as it avoids fetching data repeatedly from slower storage, saving time
    -Loaded without any delay
  • thinking ahead
    How this data is captured or relayed back to the user once processed (input and output)

    input would be touchscreen, keypad while output device would be monitor, printer, speaker
  • thinking ahead
    preconditions
    to make sure the function neven crashes what must be it

    -the function must be test for an empty
    -a precondition must be specified with the documentation for the function
  • thinking ahead
    reuseable program components
    what are these
    area of code such as functions, procedures or libraries that can be used throughout multiple programs
    example: import randome or Pygame
  • thinking ahead
    reuseable program components
    what is the process
    the problem is broken down into smaller pieces and allows developers to identify where programs that are already existing can be reused to simplify the development process.
  • thinking ahead
    reuseable program concepts
    what is advantage of reuseable programs
    -save time and resources because its tested and ready to use
    -improved reliability as the code has likely been debugged already
  • thinking ahead
    the process of computational problems
    input -> computational problem -> output
  • thinking ahead
    what does thinking ahead mean
    is the process of planning input and outputs and conditions needed for a program to work efficiently
  • thinking ahead
    what is a preconditions
    are requirements which must be met before a program can be executed
  • thinking ahead
    what is advantages of preconditions
    -reduce the length and complexity of the program as checks dont have to be repeated in every part of the program
    -save time needed to debug and maintain a longer program(the shorter the program the easier to debug and maintain)
    -they make code more reuseable and easier to manage
  • thinking ahead
    what is an input in computational thinking
    relevant information to the problem (can be entered through such as keyboard, mouse, touchscreen (ATM transaction))
  • thinking ahead
    what is an output in computational thinking
    is the solution to the problem (example: account balance displayed; receipt printed)
  • thinking ahead
    what is caching
    storing instruction and values in cache memory after use so they can be used again allowing for quick access.