2.1.3: be able to differentiate between types of error in programs (logic, syntax, runtime)
Keyword | Definition |
---|---|
logic error | a mistake by the programmer where the code runs and does what the programmer told it to do, but not what the programmer wanted it to do (e.g. add instead of subtract) |
runtime error | an error that occurs when the code runs, but tries to do something impossible (e.g. divide by zero) |
syntax error | a mistake by the programmer where the code doesn't follow the rules of the programming language. This prevents the code from running at all (e.g. missing brackets) |