🪓 Decomposition
4th Grade 💻 Coding
Decomposition means splitting a big, complicated problem into small parts, and those parts into even smaller parts, until each one is simple enough to solve.
“Build a game” sounds scary. But you can break it down: a character that moves, obstacles, a score, a start screen and an end screen. “A character that moves” breaks down into moving right, moving left and jumping. Now every part is a clear task, and you can get started.
In programming, each part you break off often becomes a function with a name. Decomposition helps with teamwork, since everyone takes a part, and with debugging, since you can test each part on its own. Tip: if you don’t know how to start something, you probably haven’t broken it down enough yet.
For example
- A social studies project: pick a topic, find sources, write an outline, write the report, add a map and check it over.
- Cleaning your room: clothes in the closet, books on the shelf, toys in the bin, then clear off the desk.
- A “catch the apple” game breaks down into a moving basket, falling apples, checking for a catch, scoring and an ending.
📌 Remember: Don’t know how to start? Break it into a smaller piece.
Quick quiz
What is decomposition?
In programming, what does each part often become?
What should you do when you don’t know how to start?