Skip to main content
ANVISoftware Solutions
Lesson 1 of 15Beginner10 min

What Is Programming?

By the end of this lesson

Explain what a program is, and why precision matters more than cleverness when you write one.

Programming is writing down instructions precisely enough that a machine can carry them out without asking you what you meant.

That is the whole job. The difficulty is not that computers are complicated. It is that they are literal. A person told to "add the numbers in this list" will work out the rest. A computer needs to be told where the list starts, what to do with each item, where to keep the running total, and what to do if the list is empty.

A recipe you cannot improvise

A recipe is a fair comparison, with one difference: a cook adapts. If the recipe says "add salt" and there is no salt, a cook substitutes or leaves it out. A computer stops, or does something you did not intend.

So a program has to handle the ordinary path and the awkward ones. That habit of asking "what if this is missing, empty, or unexpected?" is one you will build over this course.

Every program, however large, is built from a small set of ideas:

  • Hold onto values — a name, a total, a list of orders
  • Make decisions — if the balance is below zero, do something different
  • Repeat work — do this for every item, without writing it out once per item
  • Name a piece of work — so it can be reused and understood later
  • Handle things going wrong — because eventually they will

That list is the syllabus for this course. A payroll system and a mobile game are both assembled from those same five ideas, in different arrangements and at different scale.

A first look at real instructions

Three instructions, carried out in order
C#
int itemsInBasket = 3;
decimal pricePerItem = 12.50m;
decimal total = itemsInBasket * pricePerItem;

Console.WriteLine($"Total: {total}");
  • Line 1 stores the number 3 under the name itemsInBasket.
  • Line 2 stores a price. The m marks it as a decimal value, which is the right choice for money.
  • Line 3 multiplies the two stored values and keeps the result under a new name, total.
  • Line 5 writes the result out so a human can see it.

You are not expected to recognise all of that syntax yet. Notice the shape rather than the spelling: values get names, names get combined, a result gets shown. The order matters — line 3 could not come first, because the values it needs would not exist.

Where this shows up in real work

An online checkout does exactly what that example does, with more care. It fetches prices rather than hard-coding them, applies discounts, checks stock, calculates tax by region, and records the result. Every one of those additions is another decision, another repetition, or another thing that might go wrong.

The five-line version is not a toy. It is the centre of the real thing, with the real-world complications not yet added.

Summary

  • A program is a set of instructions precise enough to be carried out without interpretation
  • The useful debugging question is "what did I tell it to do?", not "why is it broken?"
  • Nearly all programs are built from five ideas: values, decisions, repetition, named work, and error handling
  • Write and run code in small pieces rather than in one large batch

Practice

Attempt each one before opening the solution. Getting it wrong first is how the idea sticks.

Think about it

Think about it

Describe how to make a cup of tea, in steps precise enough that someone who has never seen tea could follow them without asking a single question.

Then look for the assumptions you made. Did you say where the cup comes from? What if the kettle is already full? What if there is no milk?

Show solution

There is no single right answer, and that is the point. Most people write six or seven steps and discover a dozen unstated assumptions.

The gaps you found are exactly the kind you will need to close when writing programs: missing inputs, states you did not expect, and steps that only make sense if you already know the goal.

Try it yourself

Try it yourself

Using the checkout example as a model, write three instructions on paper that work out the total cost of a taxi journey: a fixed booking fee, a rate per kilometre, and the distance travelled.

Do not worry about exact syntax. Focus on which values need names and what order the steps must happen in.

Show solution

You need three stored values and one calculation. The calculation has to come last, because it depends on all three.

C#
decimal bookingFee = 2.50m;
decimal ratePerKm = 1.20m;
decimal distanceKm = 8m;

decimal fare = bookingFee + (ratePerKm * distanceKm);

Console.WriteLine($"Fare: {fare}");

Knowledge check

Nothing is recorded and there is no score. The explanation appears either way.

Why do programs need to be more precise than instructions given to a person?

Saved in this browser only.