What Are Errors?
An error is something that causes your program to produce unintended results. Those unintended results could range from the application crashing, 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 would 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
Syntax Errors
Syntax errors result from improper use of the programming language. This often occurs due to mistyping the code. Most modern IDEs will have some visual way of bringing...