What Is Programming?

Preschool, page 1 of 7. A three-minute read.

Let's start with a little story.

Imagine you just bought a brand-new robot chef. Shiny. Chrome. Very expensive. You switch it on and say:

"Robot, make me a sandwich."

The robot stares at you. Nothing happens.

Hmm. Okay. Maybe it needs more detail. You try again:

"Put the bread on the plate."

The robot picks up the entire bag of bread, still sealed, and drops it on the plate. Thunk.

"No, no! Open the bag first. Take out two slices. Put the two slices on the plate."

The robot rips the bag open (bread everywhere), grabs two slices, and puts them on the plate. Progress!

"Now put butter on the bread."

The robot places the whole stick of butter on top of the bread. Still in the wrapper.

You get the idea.

The robot isn't stupid. It's just extremely literal. It does exactly what you tell it, nothing more and nothing less. It doesn't guess. It doesn't fill in the gaps. It has zero common sense.

Computers are exactly like this robot.

A computer can do billions of things per second, but it has no idea what you mean. It only knows what you say. So if you want a computer to do something, you need to give it a list of instructions that are clear, precise, and in the right order.

That list of instructions is called a program.

And writing that list of instructions is called programming (or coding, which means the same thing and sounds cooler).

Think of it like thisA recipe for the computer

A program is a lot like a recipe. A recipe has steps that you follow in order: boil water, add rice, stir, wait 20 minutes, serve. Skip a step or do them in the wrong order and you get a mess (or crunchy rice). A program is a recipe for a computer: a set of steps it follows, one after another, from top to bottom.

So what's a programming language?

Here's the problem: computers don't speak English. Or French. Or Hindi, Swahili, Spanish, or Japanese.

Deep down, a computer only understands electrical signals that are either on or off, which we write as 1 and 0. Writing a program entirely in 1s and 0s would look something like this:

Text
01001000 01100101 01101100 01101100 01101111

That spells "Hello," by the way. Imagine writing a whole video game like that. You'd be finished in roughly... never.

So clever humans invented programming languages. A programming language is a kind of middle ground: it's precise enough for a computer to understand, but readable enough for humans to write. You write instructions in the programming language, and a special program translates them into something the computer can run.

There are hundreds of programming languages: Python, Java, C, C++, C#, Swift, Go, Rust, PHP, Ruby... and the one we're here for:

JavaScript.

Fun fact

The world's first computer programmer is widely considered to be Ada Lovelace, who in the 1840s wrote what's thought of as the first algorithm intended for a machine: Charles Babbage's Analytical Engine. The machine was never actually built in her lifetime, which means Ada wrote code for a computer that didn't exist yet. Talk about planning ahead!

Reading is step one

CurlyScript turns these notes into a game: short questions, an explanation after every answer, and a test at the end of each grade. Free, with nothing to sign up for.

Start learning