Pre-course · No syntax required
0%
Lesson 1The big ideas

What a program actually is

Before writing a single line of code, let's make sure you understand what a program is. Not in a technical way — in a human way. Everything else builds from this.

A program is just a list of instructions that a computer follows, one at a time, in order. That's it. There's no magic. The computer does exactly what you tell it to do — no more, no less. If something goes wrong, it's because the instructions were wrong, not because the computer made a mistake.

You already write programs every day — you just call them recipes, directions, or checklists.

🍳

A recipe is a program

A recipe tells you: get two eggs, crack them into a bowl, add salt, whisk, pour into a hot pan, wait 2 minutes, flip. The instructions are in order. Each step depends on the previous one. If you skip step 3, the output (the omelette) is wrong. A computer program works exactly the same way.

The four things every program does

No matter how complex — a video game, a banking app, a social network — every program boils down to just four kinds of actions:

Input

Take something in

Read from a keyboard, a file, a sensor, the internet. Something enters the program.

Process

Do something with it

Calculate, compare, transform, sort. This is the logic — the brain of the program.

Store

Remember it

Keep values in memory while the program runs, or save them to a file for later.

Output

Show the result

Print to a screen, write to a file, send over a network. Something leaves the program.

Your Java Task Manager from the beginner course does all four: it reads your keyboard input, processes tasks (add, delete, complete), stores them in a file, and outputs a list to the screen.

The computer is very literal

This is the most important mindset shift for new programmers. Computers do exactly what you say — they don't infer what you meant, they don't fill in gaps, and they don't use common sense. If you tell it to do something impossible or contradictory, it crashes and tells you why.

This feels frustrating at first. Eventually it becomes one of your favourite things about programming — the computer is perfectly honest. If it's wrong, the instructions are wrong.

💡
there is no magic

When a program seems to "know" something or "decide" something on its own, it's because a programmer wrote instructions that covered that case. The computer never surprises itself. Neither will you — you write the instructions, you know what they do.

Check your understanding
A user types their name into an app and it appears on screen personalised. Which two of the four actions are happening?
Lesson 2The big ideas

Storing information

Programs need to remember things while they run. A variable is a named box in memory that holds a piece of information. You give the box a name, put something in it, and refer to it by name whenever you need it.

📦

Variables are labelled boxes

Imagine a shelf of cardboard boxes. You write "player's score" on one box and put the number 0 in it. Every time the player earns points, you open that box and increase the number. The box exists in memory for as long as the program runs. Other parts of the program can look inside it whenever they need the score.

A variable has three parts

  • A name — how you refer to it. playerScore, userName, isLoggedIn
  • A type — what kind of thing is in the box. A whole number? Text? True/false?
  • A value — the actual thing currently in the box. Can change over time.

Types of information

In real life you naturally know the difference between a number and a person's name. Computers need you to be explicit about this. Java has a few basic types:

Whole numbers

Age, score, count

25, 0, -7, 1000000. No decimal point. Called int in Java.

Decimal numbers

Price, temperature

14.99, 3.14, -0.5. Has a decimal point. Called double in Java.

Text

Names, messages

"Alice", "Hello!", "task-001". Any sequence of characters. Called String in Java.

True or false

On/off, yes/no

Only two possible values: true or false. Called boolean in Java.

Try it — name these variables

For each piece of information below, which type fits best?

⚠️
the box changes, the name stays

A variable's name never changes — playerScore is always playerScore. But the value inside it can change as many times as you want. That's why it's called a variable — its value varies.

Check your understanding
You're building a quiz app. The user has answered 7 out of 10 questions correctly. Which variable holds their score most accurately?
Lesson 3The big ideas

Making decisions

A program that does the same thing every time isn't very useful. Conditions let your program ask a question and do different things depending on the answer. This is where logic lives.

🚦

A condition is a fork in the road

When you approach traffic lights: if the light is green, drive forward. Otherwise, stop. The light's colour is the condition. "Drive" or "stop" are the two possible actions. The program checks the condition and chooses the right path. Every second of every day, computers are doing millions of these.

The IF / OTHERWISE pattern

In plain English, a condition looks like this:

IF [something is true] do this thing OTHERWISE do this other thing instead

You can also chain multiple conditions:

IF the score is 90 or above grade = "A" OTHERWISE IF the score is 80 or above grade = "B" OTHERWISE IF the score is 70 or above grade = "C" OTHERWISE grade = "F"

Combining conditions

You can combine multiple conditions with AND or OR:

  • AND — both must be true. "If it's raining AND I have an umbrella → go outside"
  • OR — at least one must be true. "If it's Saturday OR Sunday → sleep in"
  • NOT — flips it. "If NOT raining → no umbrella needed"
Try it — condition builder

A cinema has different ticket prices. Drag the sliders and see which condition fires:

25
Check your understanding
A website checks: "IF the user is logged in AND has a premium account → show full video." A user is logged in but has a free account. What happens?
Lesson 4The big ideas

Repeating things

What if you need to do something a hundred times? Or an unknown number of times? Writing the same instructions over and over would be ridiculous. Loops let you repeat a block of instructions automatically.

🔁

Loops are like a "repeat until done" instruction

When you wash dishes, you don't write out: "wash plate 1, wash plate 2, wash plate 3...". You think: keep washing plates until the pile is empty. That's a loop. Check the condition (is there still a dirty plate?). If yes, wash one more. If no, stop.

Two kinds of loops

Almost every loop you ever write fits into one of two patterns:

Count loops

"Do this 10 times"

You know in advance how many times to repeat. Print all 30 students. Send 5 reminder emails.

Condition loops

"Keep going until..."

You don't know how many repetitions. Keep asking for a password until it's correct. Keep reading lines until the file ends.

Count loop — do this a specific number of times: REPEAT 10 times: print "Hello!" Condition loop — keep going while something is true: WHILE there are still tasks in the list: take the first task do the task remove it from the list

The danger: infinite loops

A loop that never stops is called an infinite loop. It happens when the condition you're checking can never become false. The program runs forever (or until your computer runs out of memory). This is a real mistake beginners make often. The fix: always make sure something changes inside the loop that will eventually make the condition false.

Visualise a loop

Watch a count loop run step by step. How many times?

4 times
Check your understanding
You're writing a program to find the first even number in a list. You don't know where in the list it is. Which loop type fits?
Lesson 5The big ideas

Named instructions

What if you need to do the same set of steps in multiple places? You don't copy-paste them. You give that set of steps a name, and call it by name whenever you need it. This is a function — or in Java, a method.

📋

Functions are like named recipes on a card

A chef doesn't rewrite the recipe for béchamel sauce every time they need it. They write it on a card called "make béchamel", and whenever a dish needs it, they follow that card. If the recipe ever changes, they update one card and every dish that uses it gets the update automatically. Functions work the same way.

Functions can take inputs and give back outputs

The most useful functions accept information (called parameters) and hand back a result (called a return value). Think of it like a vending machine: you put money in and press a button (inputs), and a snack comes out (output).

A function with no inputs, no output: FUNCTION greetEveryone: print "Hello, everyone!" A function with an input: FUNCTION greet(personName): print "Hello, " + personName + "!" A function with an input AND an output: FUNCTION double(number): RETURN number × 2 Calling it: result = double(5) ← result is now 10 result = double(21) ← result is now 42

Why bother with functions?

  • Write once, use many times — call the same function from anywhere
  • Easy to fix — change the function in one place, fixed everywhere
  • Easier to understand — a program made of well-named functions reads like plain English
  • Easier to test — you can test each function independently
programs are made of functions calling functions

A real program isn't one giant list of instructions. It's dozens or hundreds of small, named, focused functions that call each other. Each function does one thing. Together they do everything. This idea — breaking big problems into small named pieces — is the most important skill in programming.

Check your understanding
You have a function called calculateTax(price) that you use in 40 places. The tax rate changes from 8% to 10%. How many places do you need to update?
Lesson 6The big ideas

How a computer reads code

Understanding the order in which your instructions run — called the flow of execution — will save you hours of confusion when your program does something unexpected.

Top to bottom, left to right

By default, a computer reads your code exactly like you read this sentence: top to bottom, one line at a time, left to right. It starts at the first instruction, finishes it completely, then moves to the next. It doesn't jump ahead, skip around, or multitask.

This means the order of your instructions matters enormously. Swapping two lines can completely change what the program does — or break it entirely.

Trace the execution order

Click each step to see the computer execute it in order. Notice how the variable's value changes over time.

Three things that change the flow

Three structures break the "just go top to bottom" rule:

  • Conditions — jump to a different set of instructions depending on a check
  • Loops — go back up and repeat a section of instructions
  • Function calls — jump to another named set of instructions, finish them, then come back

You already know all three of these. Now you know how they fit into the computer's reading order.

💡
when debugging, become the computer

The most reliable debugging technique is to mentally (or literally, with a piece of paper) trace through your code line by line, tracking what each variable contains at each step. Most bugs become obvious within a few lines. Professional developers do this constantly.

Check your understanding
You have these two instructions:
score = score + 10
score = 0
What is score at the end if it started at 5?
Lesson 7The bridge

From English to Java

You now understand every concept Java uses. This lesson is nothing new — it just shows you how the ideas you already know look when written in Java's particular notation.

Every language has its own spelling for the same concepts. Java's spelling can look intimidating at first — but the ideas underneath are what you just learned. Read the English version, then look at the Java version. They say the same thing.

Storing information → Java variables
// A whole-number box labelled "score" containing 0 int score = 0; // A text box labelled "name" containing "Alex" String name = "Alex"; // A true/false box labelled "isLoggedIn" set to true boolean isLoggedIn = true;
Making decisions → if/else
// IF the score is 90 or above → grade = "A" if (score >= 90) { grade = "A"; } else if (score >= 80) { grade = "B"; } else { grade = "F"; }
Repeating things → loops
// Count loop: repeat exactly 5 times for (int i = 1; i <= 5; i++) { System.out.println("Hello!"); } // Condition loop: keep going while score is above 0 while (score > 0) { score = score - 10; }
Named instructions → methods
// FUNCTION greet(personName): print "Hello, " + name public static void greet(String personName) { System.out.println("Hello, " + personName + "!"); } // FUNCTION double(number): RETURN number × 2 public static int double(int number) { return number * 2; }
the extra syntax will make sense soon

You'll notice words like public static void in the Java versions. Don't worry about those yet — the beginner course explains each one carefully when you need it. For now, just notice that the core logic — the variable, the condition, the loop, the function — is exactly what you already learned.

Check your understanding
In Java you see: while (livesRemaining > 0) {. Without knowing Java syntax, what does this mean in plain English?
Lesson 8The bridge

You're ready

You came in knowing nothing about programming. You leave this pre-course with the mental models every programmer uses. The beginner course will give those models their Java clothing — but the ideas are already yours.

What you now understand

Programs

A list of instructions

Computers follow them in order, literally. Input → Process → Store → Output.

Variables

Labelled boxes in memory

Hold information that can change. Have a type (number, text, true/false).

Conditions

Decision forks

IF this → do that. ELSE → do something different. AND / OR for combining.

Loops

Repeat instructions

Count loops for a known number of times. Condition loops for "until done".

Functions

Named instructions

Write once, call anywhere. Take inputs, give back outputs. Break big problems into small pieces.

Execution flow

Top to bottom

Order matters. Conditions, loops, and function calls are the only things that change the flow.

A word of encouragement

Learning to program feels uncomfortable at first — not because you're not smart enough, but because it's a genuinely new way of thinking. Your brain is building new pathways. The discomfort you feel when something doesn't work isn't failure; it's learning happening.

Every professional developer you've ever heard of started exactly where you are right now. Every single one of them hit bugs they couldn't understand, wrote code that didn't work, and felt confused at 2am. What made them developers was that they kept going anyway.

The beginner course starts with exactly what you'd expect after this: Java's syntax for variables, printing output, and the structure of a program. You already understand what all of it means. Now you're just learning how Java spells it.

🎯
what to do when you get stuck

Read the error message — Java tells you exactly what went wrong and on which line. Trace through your code manually like a computer, line by line. Search the exact error message in quotes. Ask a question explaining what you expected to happen and what happened instead. These four steps solve 95% of beginner problems.

Roadmap