Computational Thinking

Computational thinking is about how to solve a problem. A computational thinker has to turn the problem into something that could be solved with an algorithm, then try to create that algorithm. For a solution to be correct, they use logical reasoning, test data and user feedback. It is necessary for any programmer

Abstraction

Abstraction is part of the first step. It is the process of removing unnecessary details while maintaining the core aspects. This helps to simplify problems.



This also happened with coding languages. It evolved from machine code, 0s and 1s. To the next generation with mnemonic codes representing instructions. Then to BASIC and FORTRAN. Where programmers didn’t need to worry about how variables were stored.

Euler’s famous bridge problem was abstraction too. He simplified the map into just the bridges, into a ‘graph’. This type of abstraction (by generalisation) is common in OOP. Where you group similar things.

Data abstraction is similar. You can hide how details are stored because they are unnecessary for the programmer, as above. Some examples are Queues and Stacks, my other page.

Thinking Ahead

  1. Using abstraction we only need the input and the expected output as the start to solve a problem.
  2. You need to define the problem, before trying to solve it.
  3. If you have solved it but it only works in specific conditions specify this in documentation as a precondition.

Preconditions can let the subroutine be reusable. Your subroutine won’t fail, and its user will know why if it does. Caching is storing temporary data or instructions that have been used recently or need to be reused. This means fast access and higher efficiency

Thinking Procedurally

Problem decomposition, breaks problems into subproblems, Top-down design breaks these down further and further into smaller manageable tasks. This makes writing, testing and maintenance easier. Hierarchy charts can represent this.

Chapter 47 is abstraction, and the different types. (pg 260 or 276)

Chapter 48 is simplfying problems from the outside, and caching.

Chapter 49 is appling abstraction, and different ways to decompose it

Overall its just about the steps you need to take before solving a computational problem

back