Syntax Errors - KS3 Computer Science Revision - BBC Bitesize - BBC

In this guide

  1. Revise
  2. Test
  1. Errors and documenting code
  2. Syntax errors
  3. Syntax errors in practice
  4. Logic errors
  5. Logic errors in practice
  6. Documenting code
  7. Using meaningful names
  8. Using comments

Syntax errors

Syntax is the spelling and grammar of a programming language. Programming languages have rules for spelling, punctuation and grammar, just like the English language. In programming, a syntax error occurs when:

  • there is a spelling mistake
  • there is a grammatical mistake

Syntax errors will cause a program to crash or not run at all. The program may run until it encounters a syntax error, then it will stop.

A syntax error in programming will cause your program to crash or shut down. If we misspell our command, our program will stop functioning.

Types of syntax error

More than one type of syntax error may exist. There may be:

  • incorrectly spelled statements
  • incorrectly spelled variables
  • missing punctuation (quotes, brackets, etc)

Any one or more of these errors may exist in a program, and each will cause the program to crash or not run at all.

Next pageSyntax errors in practicePrevious pageErrors and documenting code

More guides on this topic

  • Introduction to programming
  • Programming basics
  • Selection in programming
  • Iteration in programming
  • Boolean logic
  • Arrays and lists
  • Procedures and functions

Related links

  • Jobs that use Computer Science
  • BBC Click
  • BBC Technology news
  • Tech Tent
  • Headsqueeze
  • Khan Academy
  • Raspberry Pi
  • Code Club Subscription
  • Educational App Store Subscription

Tag » What Is A Syntax Error