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.
- When you take brief meeting notes you use abstraction
- Signs are forms of abstractions, hazard signs for chemistry or highway signs
- Little man computer is an abstraction of how a real computer might work.
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
- Using abstraction we only need the input and the expected output as the start to solve a problem.
- You need to define the problem, before trying to solve it.
- 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.