VIEW THIS AS

Auto mode follows the Route Engine until you choose a viewpoint.

YOU ARE HERE

ROUTE CHECK

CONNECTED TO

WHAT NEXT

Use the canonical route for this room, or HELP if you are unsure.

Why Vocabulary is Important in 21st Century | Debugging Student Code by Distinguishing Syntax, Runtime and Logic Errors

Did you know that a computer can follow your instructions perfectly and still give the wrong answer? That is why ‘the code is broken’ is often too vague to help a friend, tutor or teacher.

For a beginner, three useful labels are syntax error, runtime error and logic error. A syntax error means the source code does not follow the language’s grammar. A runtime error happens while a program is executing. A logic error means the program runs but its behaviour does not match what was intended. The first useful question is not ‘Which line should I delete?’ but ‘What kind of failure did we observe?’

The vocabulary acts like a map

Think of a recipe. If an instruction contains words arranged so badly that you cannot interpret it, the problem resembles syntax. If the recipe makes sense but you discover halfway through that an ingredient is missing, the problem resembles a runtime failure. If you follow every instruction and bake something different from the intended dish, the problem resembles a logic error. The analogy is imperfect, but it helps beginners stop treating all mistakes as one thing.

This distinction matters when secondary students learn basic programming, control sensors, create spreadsheet formulas or build simple games. It also builds a general English skill: choose the precise noun that describes an event rather than jumping to a vague judgement such as ‘bad’ or ‘failed’.

1. Syntax error: the code cannot be parsed as written

A programming language has rules about punctuation, indentation, names and the shape of instructions. Its parser checks whether a statement fits that grammar. Here is a deliberately faulty Python statement:

print("Hello"

The closing parenthesis is missing. Python reports a syntax problem rather than executing the intended print statement. A learner can often fix this by checking brackets, quotation marks, colons and indentation. The key expression is invalid syntax; the corresponding adjective is syntactic, and the process is called parsing.

The line pointed to by a syntax message is where the parser noticed trouble, not always where the original mistake began. The official Python tutorial makes that distinction. When a child learns the phrase error detected at instead of error caused at, they become less likely to edit the wrong line.

2. Runtime error: a valid instruction cannot complete

A program may be correctly written and begin running but encounter an operation it cannot complete. This example is syntactically valid Python:

number = int("ten")

The function tries to convert the letters in ‘ten’ into an integer. In this case, Python raises a ValueError. The relevant words are execute, exception, raise and traceback. A traceback helps locate the execution path; it should be read, not blindly copied into a search box with a student’s private data.

Runtime failures are not always caused by an obvious typo. Missing files, unsupported inputs, out-of-range values and unavailable resources can all contribute. Do not label every error message a syntax error: first ask whether any part of the program had already started executing.

3. Logic error: a plausible program answers the wrong question

Consider a fictional game whose rule is ‘a participant aged 12 or older may join’. The intended threshold is inclusive: someone who is exactly 12 is eligible. A programmer writes:

def can_join(age):
    return age > 12

That program runs, but it wrongly rejects the 12-year-old. The correct comparison for this invented rule is age >= 12. The error lies in the logical condition, not Python’s grammar. It may not produce a warning because the interpreter cannot know the game organiser’s intention.

This is where English and Mathematics meet. Older than 12 excludes 12; at least 12 includes 12. In a Mathematics word problem, confusing greater than with greater than or equal to changes the answer. In code, the same misunderstanding changes the decision rule. The age rule here is purely illustrative and is not a Singapore school or government eligibility rule.

A debugging conversation worth teaching

Student: ‘My programme doesn’t work.’ Teacher: ‘Does it refuse to start, stop during execution, or finish with an unexpected result?’ Student: ‘It runs, but someone aged 12 cannot join.’ Teacher: ‘Then check the stated rule and the boundary cases before changing anything.’

Notice what has changed: the student can report an observation and a condition. This makes a help request answerable. The same habit improves Science experiment reports: ‘The sensor output is missing after 30 seconds’ is more informative than ‘The sensor is wrong’.

A five-step diagnostic that does not guess

  • Write down the intended behaviour in one plain English sentence. Example: ‘Return true for ages 12 and above.’
  • Observe what actually happens. Record an error name, message, output or stopping point, without including passwords or personal data.
  • Classify the evidence: a parsing complaint, an exception during execution, or an output inconsistent with the stated rule.
  • Test a small change. For the age example, try 11, 12 and 13. These are boundary cases, because 12 is the exact edge of the rule.
  • Explain why the change worked, then test an unfamiliar case. Do not merely celebrate that the message disappeared.

Retrieval practice: can you name the error?

A teacher can show three cards. Card A says ‘Unexpected end of input’ after a missing closing symbol in a relevant language. Card B says the program started, then raised a division-by-zero exception on a particular input. Card C says the programme ran and returned 49 where the written specification required 50. The learners name the likely error class, then say what evidence they would still need.

The important word is likely. Some programming environments catch errors early, and some errors are data or configuration issues. These three labels are a useful first classification, not a complete taxonomy of software failures. Students must check the exact language and runtime rather than turning labels into rigid guesses.

Word families and register

In everyday English, to debug means to work out and correct a fault. Debugging is the process; a debugger is a tool or someone who investigates. To execute a program is to run it, while an exception is a special event that may interrupt ordinary execution. Trace can be a verb for following a sequence and traceback is the diagnostic record in Python.

The phrase it crashes is conversational and may describe several distinct failures. In a technical report, write what occurred: ‘The script raised ValueError when given text input.’ Do not claim it was a crash if you merely saw the wrong printed result.

Transfer to English, Science and independent learning

A pupil can transfer this vocabulary into problem solving by separating three things: the instruction, the process and the result. For reading comprehension, ask whether the question was understood. For Mathematics, ask whether the operation was performed correctly. For Science, ask whether a procedure was followed and whether the interpretation matches the observations. Those are analogies, not formal classifications of school mistakes as computer errors.

Singapore’s SEAB SEC guidance explains that the 2027 SEC uses G1, G2 and G3 subject levels. This coding exercise is not presented as a specific SEC examination item; it is practical language literacy that a Secondary student at any of those levels can practise. General English learning routes can be found at How English Works.

Frequently asked questions

Is a runtime error the same as a syntax error?

No. A syntax problem concerns the language’s grammar and parsing. Runtime errors occur during execution after code can begin to run. Exact error reporting depends on the language and environment.

Why doesn’t the computer warn me about every logic error?

Because the computer executes the instructions you wrote; it usually cannot infer the intention behind a rule. Clear specifications and tests uncover many logic mistakes.

Should students memorise error names before learning code?

Teach the words alongside tiny examples, not as an isolated glossary. Start with one mistake, ask the student to predict what will happen, observe the result, and explain it.

Reliable explanations to read next

The official Python Errors and Exceptions tutorial distinguishes syntax errors from exceptions; MDN’s beginner JavaScript troubleshooting guide explains syntax, runtime and logic errors. The eduKateSG Vocabulary hub provides a wider route from word recognition to meaningful use.

The goal of the lesson is a sentence a learner can explain: ‘My code runs, so I checked the intended boundary condition and found a logic error.’ That is a small piece of technical vocabulary doing a very large job.

Discover more from eduKate Singapore

Subscribe now to keep reading and get access to the full archive.

Continue reading