Breaking Problems into Steps — Decomposition
Master decomposition, the most important skill in programming: breaking complex problems into small, solvable pieces.
Big Problems are Just Small Problems Stacked Up
How to Decompose a Problem
Decomposition Example: Building a To-Do App
BIG PROBLEM: Build a to-do list app
Part 1: Display tasks
- Create an empty list to store tasks
- Show each task as a list item on screen
- Show 'No tasks yet' if list is empty
Part 2: Add tasks
- Create an input field and Add button
- When button clicked, read the input
- Add input text to the task list
- Clear the input field
- Refresh the display
Part 3: Complete tasks
- Add a checkbox to each task
- When checked, mark task as done
- Show completed tasks with strikethrough
Part 4: Delete tasks
- Add a delete button to each task
- When clicked, remove task from list
- Refresh the display
Now each step is small and buildable!Professional developers use this technique every single day. In team settings, they break projects into 'tickets' or 'stories' — small, well-defined pieces of work. A ticket might say: 'Add a delete button to task items that removes the task when clicked.' That is specific enough that any developer on the team could pick it up and build it.
Pick one of these projects and break it into the smallest possible steps: A) A weather app that shows the current temperature for any city. B) A flashcard app for studying vocabulary. C) A personal diary/journal app. For your chosen project, write out: the main parts (at least 4), the smaller steps within each part (at least 3 per part), and the order you would build them in (start with the most important feature). If any step takes more than a sentence to describe, break it down further!
Ready to build?
Put what you learned into practice — pick a project and start coding.
Start Building Free