Thinking Like a Programmer 🧠

Before we code, we must simplify and break down our problems!

🎨 Abstraction

Definition: Removing unnecessary details to focus on the important parts of a problem.

Relatable Scenario: Driving a Car

To drive a car, you need to know about the steering wheel, pedals, and gears. You do not need to know how the engine burns fuel or the exact chemistry of the battery. Those details are abstracted away so you can focus on driving!

Coding Example: Player Character

If you are making a game, your code needs to know the player's health and position. It doesn't need to know the player's favorite color or what they had for breakfast!

🧩 Decomposition

Definition: Breaking a large, complex problem down into smaller, more manageable parts.

Relatable Scenario: Making a Sandwich

You don't just "make a sandwich" in one giant step. You decompose it:

  • Get two slices of bread
  • Spread the butter
  • Add the fillings
  • Put the slices together
Coding Example: Creating a Login Screen

Decompose the task into: 1. Designing the text boxes, 2. Saving the password, 3. Checking if the password is correct, 4. Showing an error message if it's wrong.

Abstraction = SIMPLIFYING
Decomposition = BREAKING DOWN

Year 9 Computer Science | Computational Thinking Skills