syntax and other errors

When you write a computer program you need to make sure you test it thoroughly. Imagine if you sell your software to clients and very soon your client is calling you, unhappy that your program does not work correctly!

There are three common errors associated with computer programs:

  1. syntax error: this happens when you make a mistake in writing the code using your chosen programming language. For example, you forget to end a line of code with ' in Javascript.
  2. logic error: you make a mistake with logic in your program eg if x> 0 or x< 100. Your program will run, but the logic is wrong and you will not get the expected output or result.
  3. runtime error: this error occurs when the program is running but for some reason it crashes. For example, your code does some division calculations and the user inputs zero.