IGCSE Computer Science: Programming Languages, Translators and IDEs — Tutor Prep Guide
- 2026-11-27
Students can say a compiler is faster but cannot work out when compiling pays, nor what each translator does on meeting an error. This chapter puts speed, error reports and IDE functions on one table using a single thousand-line program.
01 Prerequisites (3-minute check)
If any of these fails, fix it before the lesson starts.
| Skill | Quick check | Pass mark |
|---|---|---|
| Machine code | What does a machine-code instruction consist of? | An opcode and an operand, all in binary |
| Programs and translation | Can a computer run Python source directly? | No, it must be translated into machine code first |
| Unit conversion | How many MiB are in 180 KiB? | 0.176 MiB, dividing by 1024 |
02 Lesson flow (60 minutes)
| Time | Stage | Tutor does | Student does |
|---|---|---|---|
| 0-8 min | One statement, two ways | Write one addition in a high-level language and in assembly | One assembly line maps to one machine instruction |
| 8-22 min | Four comparisons | Compare readability, debugging, portability and hardware access | Low-level reaches hardware but cannot move between machines |
| 22-30 min | Assembly and the assembler | Show 40 lines of assembly | Mnemonics translate one for one into machine code |
| 30-48 min | Compiler against interpreter | Compare 1,800 milliseconds with 5,000 | Break even at 10 runs and 2.78 times at 50 |
| 48-55 min | Error reporting | 5 errors in 200 lines | A compiler reports all 5, an interpreter needs 5 runs |
| 55-60 min | Seven IDE functions | Demonstrate each and say what time it saves | Auto-completion saves 70 per cent of keystrokes |
03 Teaching script (read it out)
Scene 1: High-level and low-level — one addition, two ways to write it
Teach all four comparisons, because the exam asks for them. Ease of reading and writing: high-level wins, one line per idea, while low-level needs registers and addresses in mind. Ease of debugging: high-level wins, because the error message names the line and the variable, while in low-level you only see the wrong number in a register. Machine independence: high-level wins, because one source file runs on another processor once it is recompiled, while low-level has to be rewritten for a different instruction set. Direct manipulation of hardware: low-level wins, because you can name a memory address, a register or an input port, which is exactly what drivers and embedded code need.
Put numbers on it: a 6-line high-level program compiles to about 54 machine instructions, 9 per line, while the same job in assembly takes 40 lines, one instruction each. To move it to 3 processors takes one high-level source file or 3 assembly versions. That is what machine independence means in practice: not that nothing is translated, but that one source can be translated for many machines.
Students write total = total + 1 as four lines of assembly and say which line loads and which stores.
Scene 2: Three translators — assembler, compiler, interpreter
A compiler reads the whole source once, checks the syntax, translates it and produces an executable file; every later run uses that file and needs neither the source nor the compiler. 24 KiB of source becomes a 180 KiB executable, 7.5 times the size, because the file carries machine code, constant tables and linked libraries. One compilation takes 800 milliseconds.
An interpreter produces no file; it reads a line, translates it and runs it, then moves to the next, and every run interprets the source again. This 1,000-line program at 0.1 milliseconds per line takes 100 milliseconds per run.
Work out when compiling pays. Compiling costs 800 milliseconds and each run costs 20; interpreting costs 100 per run. Setting 800 plus 20 n equal to 100 n gives n equal to 10: below 10 runs interpreting is cheaper, above it compiling is. At 50 runs, compiling totals 1,800 milliseconds against 5,000, which is 2.78 times faster. This is why the syllabus says an interpreter is mostly used while developing and a compiler for the final program: during development the code changes and a compile each time does not pay, while a delivered program may run thousands of times and one compile is recovered at once.
Students work the break-even point out themselves, then answer which translator suits a small tool that runs three times.
Scene 3: Error reports and the IDE — from typing to running
An IDE puts everything needed to write a program into one application. 0478 lists seven functions: a code editor with syntax highlighting and line numbers; a run-time environment that runs the program in the same window; translators built in, whether compiler or interpreter; error diagnostics that list errors with line numbers; auto-completion that suggests a whole name after a few characters; auto-correction that closes quotes and brackets and fixes keyword spelling; and prettyprint that lays out indentation automatically.
Numbers: a variable name of 40 keystrokes takes 12 with auto-completion, saving 70 per cent. Indentation of 4 spaces per level over 8 levels is 32 spaces, which nobody types correctly, so prettyprint does it in one command. Run one setting through all seven: a mistyped variable name is flagged by the editor; auto-completion prevents most of them; error diagnostics point at the line when it runs; the built-in translator runs it again after the fix; and prettyprint tidies the layout before handing in. If any one of the seven is missing, students reach for an outside tool and lose the time the IDE was meant to save.
Give a short program with two errors and ask what the compiler and the interpreter each report, and which IDE function helps.
04 Question types and worked steps
| Type | Example | Steps | Answer |
|---|---|---|---|
| Classifying a language | Is assembly language high-level or low-level? | Ask whether one line maps to one instruction and whether registers are named | Low-level, using mnemonics and an assembler |
| Choosing a translator | A program that will run 50 times | Find the break-even point, then compare totals | Compiling, at 1,800 milliseconds against 5,000 |
| Comparing error reports | 5 errors across 200 lines | Ask how many are reported at once and how many runs are needed | A compiler reports 5 at once, an interpreter needs 5 runs |
| Matching an IDE function | Suggestions appearing while typing is which function? | Match to the list of seven and answer one | Auto-completion |
05 Independent practice (3 questions)
| Question | Answer | What to watch |
|---|---|---|
| Compiling takes 800 milliseconds, a compiled run 20 milliseconds and an interpreted run 100 milliseconds; after how many runs does compiling pay? | More than 10 runs (800 plus 20 n equals 100 n) | Check that the compile cost is included |
| 24 KiB of source becomes a 180 KiB executable; how many times larger is it? | 7.5 times | Check the division of executable by source, not the reverse |
| 5 syntax errors in 200 lines; how many runs does an interpreter need at least? | 5 runs, one error each | Check that it stops at the first error |
06 Common mistakes and what to say
| Mistake | Student writes | Say this |
|---|---|---|
| Thinking a high-level language needs no translation | Python is understood directly by the computer | Every language is translated into machine code; a high-level one just leaves the translation to a compiler or interpreter. |
| Calling an assembler a compiler | The assembler turns C into machine code | An assembler translates assembly only, one for one; a language such as C needs a compiler. |
| Saying a compiler is always faster | Compiling is always quicker | Only after 10 runs; for a few runs the 800 millisecond compile costs more. |
| Treating an IDE as a language | An IDE is a programming language | An IDE is an environment holding an editor, a translator and a run time; the language is what you write. |
07 Homework (paper, section and question numbers)
- IGCSE Computer Science chapter index — Every chapter in this subject
- All prep guides — The same series in other qualifications
- Redo this chapter — Practice 1 to 3: break-even, file ratio, error runs
08 Exit check (last 5 minutes)
| Question | Answer | Decision |
|---|---|---|
| One difference | A compiler translates all at once into an executable, an interpreter line by line | Cannot state it means scene two again |
| One break-even | 10 runs, 800 milliseconds against a 80 millisecond gap per run | Cannot work it out means the end of scene two again |
| Seven functions | Editor, run time, translators, diagnostics, auto-completion, auto-correction, prettyprint | Cannot list them means scene three again |
09 Tutor FAQ
Why is an interpreter mostly used in development?
Because code changes constantly. A compile costs 800 milliseconds and a developer may change the code several times a minute; an interpreter takes 100 milliseconds per run and stops on the offending line.
Can a compiler and an interpreter be used together?
Yes. Some systems compile to an intermediate code that a virtual machine then runs in pieces; 0478 only asks students to separate the whole-program and line-by-line models.
How does assembly differ from machine code?
Assembly is written with mnemonics a person can read, machine code is binary. They map one for one, so 40 lines of assembly are 40 machine instructions, converted by an assembler.
Find a tutor — freeTutor Registration →
A TutorZone lesson-prep guide. Written by the TutorZone team; questions and lesson flow are original and are not taken from any school or publisher material.



