← Mission map

Mission 5 of 16

Functions & Decomposition

📋 What it is

A function is a named, reusable block of code that does one job; decomposition breaks a big problem into such pieces.

🗣️ Coach says

A FUNCTION is a mini-program with a name that does one job — call it whenever you need that job done, instead of rewriting it. DECOMPOSITION is breaking a big problem into small function-sized pieces. Together they turn a scary big task into a set of small, solvable ones.

🧠 Memory hook

A function = a named reusable job. Decompose big problems into small function-sized pieces.

😂 Giggle

Why do programmers prefer dark mode?
Because light attracts bugs!

😲 Whoa!

Every huge program — even the one running a spacecraft — is built from thousands of small functions, each doing one tiny, testable job.

✅ Quick check: What is "decomposition" in programming?

Say your answer out loud first — then reveal.

🧪 Try it! (2 minutes)

Take a big task (make breakfast) and break it into named "functions": makeToast(), pourJuice(), etc.

⭐ Do the round to earn your star →
🤸 Brain break: Break-it-down: mime chopping one big block into several small ones — decomposition.