What are errors?
An error is something that causes your program to produce unintended results. Those unintended results could range from the application crashing, an incorrect data calculation (such as a bank transaction not being processed correctly), or not providing any results. These unintended results are referred to as software bugs. Any software will contain errors during its lifetime due to numerous scenarios that programmers do not anticipate. The following are possible outcomes when errors occur:
- The erroneous code could cause the program to crash without warning
- The output of the program was not the intended result
- An error message is displayed
There are three types of errors that you might encounter:
- Syntax errors
- Runtime errors
- Semantic errors
Let’s explore each one in more detail.
Syntax errors
Syntax errors result from improper use of the programming language. This often occurs due to mistyping the code. Most...