GCSE · Computer Science · Eduqas · Spec C500QS

Compilation and interpretation of code

Imagine leaving your editor, opening another program, translating your code, then hunting for the output, every time you change one line. Now imagine one button.

Computer Science · Development environments

Press Run. Read. Fix. Run again.

This program should print the total cost of 3 items that cost £4 each. Press Run, read what comes back in the same window, then choose a fix for the flagged line. Keep going until the output is what you expected.

Python
  1. price = 4
  2. quantity = 3
  3. total = price + quantity
  4. print("Total cost:", total

The messages and outputs are what Python 3.13 gives for this exact code. The program is just an example.

Two ways to translate

CompilingvsInterpreting

The environment may use either one. Start with the first row: it is the difference people mix up most.

Focus

When does translation happen?

Compiling

The whole program is translated before any of it is run.

Interpreting

Translating and running take turns: a statement is translated, then run, then the next one.

The insight

This is the one to remember. Compiling is translate everything, then run. Interpreting is translate a statement, run it, repeat.

How much is translated at a time?

Compiling

The whole program.

Interpreting

One statement at a time.

What do you press inside the environment?

Compiling

A single command such as a Run or build button.

Interpreting

A single command such as a Run button.

Computer Science · The testing loop

Write, run, check, edit

2 stages are missing. Use the rest of the loop to work out which goes where.

  1. Stage 1: Write a little code

    Add a few lines, or change one.

  2. Stage 2: Press Run

    The environment translates the program and runs it.

…and stage 4 leads back to stage 1.

Exam line: Quick runs inside the environment make small, frequent tests cheap, so problems are found sooner.

Computer Science · What happens on Run?

What do you think Run does?

Maya has typed a few lines of a program into her development environment. She clicks Run.

Which is closest to what you think is going on?
How sure are you?

Computer Science · Put it into words

Explain it in your own words

Explain how being able to compile or interpret code from within the development environment helps a programmer while they are writing and testing a program. [4 marks]

0 words · your answer stays on this page and is not sent anywhere.

WHAT YOU'VE LEARNED

A quick recap of today's lesson.

How pressing Run inside your editor lets you test little and often

What you need to know

  • A development environment (an IDE is one kind) brings together, in one program, the tools you use to write, translate and run code.
  • Compilation and interpretation of code is one of the software tools a development environment provides.
  • From within the environment you can translate your source code into a form the computer can execute, then run it, typically with a single command such as a Run button.
  • Have a goMaya says, 'Run just makes the computer do exactly what I typed.' Using what you have read so far, what is missing from her idea?

    The code is translated into a form the computer can execute before it is run.

    Source code cannot be executed as typed. Translating comes first, and the environment typically does both with one command.

  • The environment may compile your program (translate the whole thing before it runs) or interpret it (translate and run it one statement at a time).
  • Have a goAn environment translates statement 1 and runs it, then translates statement 2 and runs it, and so on. Is that compiling or interpreting?

    Interpreting.

    Compiling would translate the whole program before running any of it. Interpreting takes translating and running one statement at a time.

  • Translating and running happen inside the environment, so you do not leave the editor or use a separate translator. That saves time.
  • The output appears inside the environment too, so you can compare what the program does with what it was expected to do.
  • Running straight away gives you a quick write-run-check-edit cycle: make a change, run again immediately, see the effect.
  • Have a goYou have just changed one line of your program. Following the quick cycle, what do you do before you change anything else?

    Run it again straight away and check the output.

    The cycle only works if you run after the change, not after piling up more edits, so you see the effect of that one change.

  • That lets you test often and in small steps while you write, not only when the program is finished, so problems are found sooner.

The big picture

A development environment lets a programmer translate their code, by compiling or interpreting it, and run it from the same place, usually with one Run command. The output appears there too, so the programmer can test often and in small steps and find problems sooner.

Key points

1A development environment brings the tools to write, translate and run code together in one program.
2Compiling translates the whole program before it is run; interpreting translates and runs it one statement at a time.
3Translating and running inside the environment means no leaving the editor and no separate translator, which saves time.
4The output is shown inside the environment, so you can compare it with what you expected.
5A quick write-run-check-edit cycle lets you test often and in small steps, so problems are found sooner.

Worked example

Problem

Lena is writing a program that adds up three test scores (12, 15 and 18) and prints their average. She is using a development environment with a Run button. How can she write and test it so that any problem is easy to find?

⚠ Watch out

Writing only 'it saves time' and stopping there. Say what saves it: translating and running happen inside the environment, so you do not leave the editor or use a separate translator.

🧠

Memory hook

Write, Run, Check, Edit, and never leave the editor. Little and often beats big and late.

✓

Check yourself

Cover the page and explain what Run does to your code, where the output appears, and why that lets you test in small steps.

Flashcards

(10)
What does a development environment (such as an IDE) bring together?
In one program, the tools a programmer uses to write, translate and run code.
How is code usually translated and run from inside a development environment?
Typically with a single command, such as a Run or build button.
What is compiling?
Translating the whole program before it is run.
What is interpreting?
Translating and running a program one statement at a time.
Is pressing Run just running your code as you typed it?
No. The code is first translated into a form the computer can execute (compiled or interpreted), then run.
Why does translating inside the environment save time?
You do not need to leave the editor or use a separate translator program.
Where does the program's output appear, and why is that useful?
Within the development environment, so you can compare what the program does with what it was expected to do.
What is the write-run-check-edit cycle?
Make a change, run the program straight away, check the output, edit again.
When should you test a program you are writing?
Often and in small steps while writing, not only when it is finished.
Which kind of tool in a development environment does the translating?
Compilation and interpretation of code, one of the software tools it provides.

Tap any card to flip it, or use Study as deck to go through them one at a time. In the full lesson these run as a spaced-repetition deck — you rate each card Hard, Good or Easy and the tricky ones keep coming back until they stick.

Learning with Lightbulb is opening soon

You can use this lesson now. Join the waitlist and we'll let you know when the full Lightbulb experience is ready.

Keep me posted

More Eduqas GCSE Computer Science topics

See the full Eduqas Computer Science curriculum →

How this lesson was checked. This Eduqas GCSE Computer Science (specification C500QS)lesson was published through Lightbulb Learning's human-designed editorial process — the educational standards, accuracy rules and publication checks it must pass were authored and approved by Philip Halpin. It passed subject-specific assessment, automated educational checks and technical publication verification before going live (publication checks completed 15 November 2026). Published pages are monitored, human spot-checking is ongoing across the lesson library, and anything found wrong is corrected or withdrawn. How our lessons are made and checked. Spotted a mistake? Email hello@lightbulblearning.co and we'll review it.