Computational thinking
Thinking like a computer scientist
- Computational thinking is the set of mental tools for analysing a problem and designing a solution a computer can run.
- Two of the most important are abstraction and decomposition.
- Master them and big problems become approachable.
Abstraction
- Abstraction means keeping the essential features of a problem and ignoring irrelevant detail, giving a simpler model.
- A train-network map keeps the stations and lines but drops real geography.
- A function hides a piece of work behind a name; a class keeps only the attributes the system needs.
- Without it, a full model of any real problem would be too big to reason about.
Practice
Abstraction means:
Abstraction simplifies a problem to its essentials. Breaking into parts is decomposition.
Practice
Which is an example of abstraction?
The map keeps what matters (stations, connections) and discards the rest — a classic abstraction.
Decomposition
- Decomposition means breaking a large problem into smaller sub-problems, each easier to solve.
- Find the main parts → break each into sub-tasks → continue until each is small enough to code directly → solve and combine.
- "Manage stock" → "record sales", "record deliveries", "produce reports" → ("record sales") "look up product", "decrease stock count", "save transaction".
- It makes problems manageable, lets a team divide the work, and gives modular code.
Practice
Decomposition means:
Decomposition splits a big task into smaller, separately-solvable sub-tasks.
Practice
A benefit of decomposition is that:
Smaller sub-tasks can be shared among a team and built as independent, reusable modules.
You've got it
Key idea
- abstraction = keep the essentials, ignore irrelevant detail (a simpler model)
- decomposition = break a big problem into smaller sub-problems
- decomposition enables teamwork and modular code
- together they make complex problems solvable