A programmer wants to write a recipe app. Instead of writing the whole thing as one giant tangle of code, they break the problem into smaller separate parts, like 'search recipes', 'display a recipe', and 'save a favourite'. What is this problem-solving technique called in computer science?
- Encryption
- Decomposition
- Compilation
- Debugging
Why B? And why not the others?
Correct answer: B. Decomposition
Decomposition is the computational-thinking skill of breaking a large, complicated problem down into smaller, more manageable sub-problems, each of which is easier to design, write, and test on its own before being combined into the finished program, which is exactly what splitting a recipe app into 'search', 'display', and 'save favourite' pieces does. It is taught alongside other computational-thinking skills like abstraction and pattern recognition because it makes large projects manageable. The option describing encryption is wrong because encryption is about scrambling data so it can only be read by someone with the right key, which has nothing to do with structuring a programming problem. The option describing compilation is wrong because compilation is the separate process of translating finished source code into machine code the computer can run, which happens after the code is written, not a technique for planning how to divide up a problem. The option describing debugging is wrong because debugging means finding and fixing errors in code that already exists, which is a later step in development, not the initial act of splitting a problem into smaller parts.
Source: BBC Bitesize GCSE Computer Science: Computational thinking - decomposition