Abstraction for Kids: Ignoring the Details That Do Not Matter

· 3 min read · By the Tiny Coderz team

Abstraction sounds like a word from a university lecture. But children already use it constantly. When your child draws a stick figure to represent a person, they ignore the hair, the shoelaces and the freckles and keep only what is needed: a head, a body, arms and legs. That is abstraction: keeping the important parts and leaving out the rest.

It is the third pillar of the four pillars of computational thinking, and probably the hardest to explain. The trick is to use examples.

Everyday examples

  • A map. A map of a city leaves out every tree, window and parked car. It shows roads and landmarks, because that is what you need to find your way.
  • A bus route diagram. It shows stops in a straight line even though the real road bends. The shape of the road does not matter for choosing a stop.
  • A recipe. It says "bake for 20 minutes" without explaining how the oven works.
  • A car. You press the pedal and the car goes faster. You do not need to know about the engine to drive.

In each case, someone hid the messy details so you can use the thing more easily.

Abstraction in code

Programmers do this all day long. The most common form is the function. When you write print("Hi"), you do not know exactly how the computer lights up pixels on the screen, and you do not need to. Someone packaged all that complexity behind a simple name.

When your child writes their own function, they are making an abstraction:

def draw_square(size):
    for i in range(4):
        forward(size)
        right(90)

Now, whenever they need a square, they write draw_square(50) and stop thinking about the four sides and the turns. The detail is hidden; the idea remains. You can read more in Python functions for kids.

In Scratch, a custom block does the same job, hiding a pile of blocks behind one friendly name.

Variables are abstraction too

A variable called score stands for "whatever the player's points currently are." We stop caring about the exact number and think about the idea. See what is a variable.

An activity to try

Ask your child to describe how to get from the front door to the kitchen, first for a robot that knows nothing and then for a visiting friend.

  • The robot needs every single step: turn left, walk 5 steps, and so on.
  • The friend only needs "it's through the hallway on the right."

Then talk about it: "Which version hides the details? When is each useful?" Children quickly see that the short version only works when the listener already understands the details. That is why abstractions are built in layers.

When abstraction goes wrong

Hiding too much can confuse people; hiding too little buries them in detail. A good rule for kids: name things so that the name tells you what they do. draw_house is better than thing2.

Where to go from here

Abstraction takes time to settle in, and that is fine. Revisit it as your child's projects grow bigger and they start naming their own functions. The Thinking course includes playful activities that bring the idea to life without any jargon.

Try Thinking Like a Coder with your child

Every lesson in Thinking Like a Coder opens with an animated explanation, then a short practice. You can read a full sample lesson with no account.

Keep reading