chaper 47

abstraction

abstraction is the process by which you decrease the amount of detail in a problem in order to make it easier to solve without as much distraction some examples are:

allows for people who are travelling to easily be able to tell where they are going and which train to catch, but is not the actual positions of the rail lines.

chapter 48

preconditions

preconditions are used to make programs shorter and more readable by providing a condition that must be met at the beggining of that subroutine in order for it to do the rest of it

by having more readable code it is easier for others to understand and change/improve your code

cacheing

cacheing is when data is temporarily stored and may need to be used shortly afterwards, an example is webpages:
  1. choose to load onto different webpage
  2. store previous webpage in cache
  3. actually load onto the new webpage
  4. do things on that new webpage
  5. decide to go back to that old webpage
  6. that webpage is reloaded from the cache(quicker!!!)

chapter 49

Top-down design

This is when you break down a problem into smaller but still major tasks,
these smaller tasks can be broken down into more smaller tasks until the problem can be solved by writing multiple small functions/subroutines

This is useful since it is much easier to test and maintain the code as errors can easily be found in the functions and then fixed,
this leads to the simple way of displaying this decomposition:

Hierarchy charts

this is a diagram where there is a box(the main problem) which is split into multiple boxes,
each focused on a part of the overall problem, and boxes come from these boxes to display the whole Hierarchy
and simplify the problem while also clearly showing how each part is used to solve the overall goal