Looping Explained to a 1st Grader

Posted by Andrew Bourgeois on March 28, 2020

Like many concepts in programming, their inherent abstraction can make them hard to grasp and conceptualize for many of us. Is it possible to make looping understandble enough that even a first-grader could make sense of its most basic functions?

**Let’s try and see. **

Sometimes, we need to do something, but more than once.

Like, sometimes you might put a toy away or throw a ball to your friend, but you want to do it more than once.

This is why we have loops! A loop is like a circle. Can you find the end of a circle? Me neither! That’s why we call it a loop because it goes round and round forever.

What if you had a robot that could clean your room or throw the ball for you? You could just tell him what you want him to do and he would do it. But, the problem is that if you don’t tell him to stop he’ll never quit doing what you told him to do. We need to make sure that we let him know when to stop!

There are different ways we can tell this robot when to stop. We could say “Stop when everyone has caught a ball.” or “Stop after you’ve thrown ten balls.” or “While everyone doesn’t have a ball, keep throwing them!” That last one, might sound a bit weird, but it’s just different way of saying the same thing!

In a way, a computer is just a robot. The computer will do exactly what you tell him to do. We can tell the computer to do things and when to stop doing them. This is how looping works with compters. We could tell the computer to start counting, but then that he needs to stop when he gets to ten.

This is how we can use ‘looping’ with computer programs!