TechnologyComputing

Programming Basics: fun facts and quiz

The essentials in 7 ideas, with fun facts, an illustrated story and a quiz to see how much you know.

The essentials

Learn

What Code Is

Code is a set of instructions written in a programming language, like Python or JavaScript, that tells a computer exactly what to do.

Key fact
Computers do exactly what code says, even when it’s wrong.

Learn

Variables

A variable is a named box that holds a value, like score = 10. The program can read it and change it as it runs.

Key fact
Good variable names make code easier to read.

Learn

Loops

Pixel-art picture: Loops

Loops repeat instructions. Instead of writing “print” 100 times, a loop can do it in two lines.

Key fact
An infinite loop never stops, which can freeze a program.

Learn

If Statements

An if statement lets a program make choices: if the password is right, open the account; otherwise, show an error.

Key fact
“else” covers what happens when the condition is false.

Learn

Bugs & Debugging

Pixel-art picture: Bugs & Debugging

A bug is a mistake in code. Debugging means finding and fixing it, often by testing small pieces and checking what the program actually does.

Key fact
Explaining your code to a rubber duck is a real debugging trick.

Learn

The First Programmer

In 1843, Ada Lovelace published what’s often called the first computer program, for Charles Babbage’s Analytical Engine, which was never built.

Key fact
The Ada programming language is named after her.

Learn

Many Languages

There are hundreds of programming languages. JavaScript runs in web browsers, Python is popular for data and AI, and Swift and Kotlin build phone apps.

Key fact
JavaScript was created in just 10 days, in 1995.

Fun facts

Did you know?

Early programs were written by punching holes in paper cards, usually one line of code per card.

Did you know?

In many languages, x = x + 1 is perfectly fine: there, = means “store”, not “is equal to”.

Did you know?

Apple’s old headquarters stood at 1 Infinite Loop, named after the programming idea.

Did you know?

A classic bug is writing = instead of == in an if statement: it stores a value instead of comparing two.

Did you know?

Programmers call a bug that vanishes as soon as you try to study it a “Heisenbug”.

Did you know?

Ada Lovelace was the daughter of the poet Lord Byron.

Did you know?

Despite the name, JavaScript has almost nothing to do with the language Java.

Story: The Key Nobody Would Press

Story time
Picture for the story “The Key Nobody Would Press”

The Key Nobody Would Press

1968. Margaret Hamilton leads the team writing Apollo’s flight software. Her young daughter, playing at the simulator, crashes it by pressing the wrong key.

Story time

Hamilton wants to guard against that mistake. NASA says no: trained astronauts would never make it.

Story time

On Apollo 8, astronaut Jim Lovell made exactly that mistake, wiping the navigation data. Her team found a fix, and she got her safeguard.

True or false?

Tap your answer to see if you got it, and why.

  1. Question 1 of 10

    Python is a programming language.

    Show the answer

    True. One of the most popular in the world.

  2. Question 2 of 10

    A variable stores a value under a name.

    Show the answer

    True. Like a labelled box.

  3. Question 3 of 10

    A loop repeats instructions.

    Show the answer

    True. As many times as needed.

  4. Question 4 of 10

    An if statement lets a program make decisions.

    Show the answer

    True. It chooses what to do next.

  5. Question 5 of 10

    Debugging means finding and fixing mistakes in code.

    Show the answer

    True. Every programmer does it daily.

  6. Question 6 of 10

    Ada Lovelace wrote an early computer program in the 1840s.

    Show the answer

    True. For a machine that existed only on paper.

  7. Question 7 of 10

    JavaScript runs in web browsers.

    Show the answer

    True. It makes web pages interactive.

  8. Question 8 of 10

    Computers can guess what code was meant to say.

    Show the answer

    False. They follow it literally.

  9. Question 9 of 10

    A variable’s value can never change.

    Show the answer

    False. It can change as the program runs; that’s why it’s called a variable.

  10. Question 10 of 10

    Loops can only run once.

    Show the answer

    False. They can run many times, or forever.

Soda the cat

Keep going in the app

KnowSoda learns what you know and brings back what you’re about to forget. Programming Basics has 6 more ideas at the Advanced and Expert levels.

Get it onGoogle Play Coming soonApp Store

Sources