Programming for Kids - Programs

Image

Why do we need Programs?

See these planes. They will be landing any minute now. First, they would have to call flight control to get permission for landing. If there was one plane that need to land this hour, the plane could land anytime they wanted – as long as the runway was clear of course. That’s easy if it’s one plane. What if there were two planes that need to land this hour? Now flight control has a rule that you need 5 mins between landings just to make sure that they have enough time to clear the runway again.

Now imagine if they have to do this for a 20 plane. Would it be possible? Crunching some numbers in an ancient artifact called the calculator, you can find out quickly that it’s not possible. What if it was not just 20 planes but 100s of planes landing and also taking off but and also now we have 5 runways. Now here’s the hard part. You have to tell each plane what time they are allowed to land and on which runway. A small miscalculation can cost many lives. The stakes are high so no mistakes are allowed. That’s where we need something that can run 24 hours 7 days a week and make calculations for landing times.

A computer program is a tireless calculator. It can calculate landing times and assign which runway a plane can land on.

What is a Program?

The word “Program” might seem like a big word. In a nutshell, a program is a list of instructions for a computer do stuff.

Suppose, you know the recipe to the world’s best recipe to make a peanut butter and jelly sandwich. How would you describe to your friend the steps to follow to make a similar sandwich?

You might say something like this:

Step 1. Take a piece of bread
Step 2. Put peanut butter on bread
Step 3. Take another piece of bread
Step 4. Put jelly on bread
Step 5. Put the two pieces of bread together

What if we tried to give the same list of instructions to a computer.

Step 1. Take a piece of bread… 
        => The computer will return an error.

The computer is saying wait a minute, where are you taking the bread from here. When giving instructions to a computer you have to it where to look for it and describe every detail. The computer is not an intelligent object. It is simply a bunch of switches with electricity following through it.

Let’s try again.

Step 1. Take the bag of bread from the counter and open it 
        and take a slice of bread out.

That’s a lot of words for step 1. A human can understand when you say Take a piece of bread because it a human is smart enough to read in between the lines. A computer is unlike its human creators. It needs to know every detail.

Now you know, a program is a list of detailed instructions for a computer to follow to do stuff

How do we make a Program?

As of 2019, computers are not yet ready to create complex programs for other computers to follow. Programs are created by people that know the language, grammar, and rules of the computer. The people that know how to create programs are called programmers. Programmers use computers to write instructions for other computers to perform certain actions of behave in a certain way.

Just like you know English, a computer likewise knows how to speak in their own computer language. Unlike humans, computers have the remarkable ability to learn many languages quicker than humans can learn a language. Computers learn new languages in a matter of seconds by downloading a new language into their computer system. A programmer’s job is to write down a list of instructions that the computer understands in order to perform many actions. In the next lesson we will learn about how computers can remember information and how it can even remember your name.