What is a programming error?
Programming errors affect the code of software. This is implemented incorrectly, which is why the application does not work as expected. There are basically five types of programming errors. These can be mutually dependent.
Probably every user has already experienced a ” bug “. For example, the screen flickers briefly, then the currently running program crashes. The background to such bugs, which are also called software or program errors, are programming errors.
The terms are often used synonymously, the boundaries are fluid. A runtime error is, for example, a software error, but not necessarily a programming error, as it can also be provoked by an incorrect program call or incorrect entries.
The term programming error implies that the code of the software (or in serious cases: the firmware) has been implemented incorrectly. At some point the developers ignored one of the requirements of the language in which they wrote the code of the program. HTML 5 or Java Script are examples of languages in which end users often experience bugs, as these play an important role in web development.
Types of programming errors
There are basically five different types of programming errors. Problematically, these can be mutually dependent. But one after the other. First of all, the five types are named and explained:
- Lexical error:This is the simplest and most difficult bug to find. A typo was made somewhere. Often it is upper and lower case that causes problems, but inverted letters also fall into this category.
- Syntactic error:The “grammar” of the language is wrong. In plain language this means: A syntactic error describes a wrong sentence structure. Positive: Compilerand interpreter can recognize this and immediately reject the code in the test run to draw attention to the error.
- Semantic error:This problem arises when working with variables that were not previously defined. So the code doesn’t make any sense, even though everything else is actually correct. As a drastic example: “The sun drives a car today.” Everything fits, but the sentence is nonsense. However, if the “sun” is a variable and is defined as “Mr. Schulz”, the sentence is: “Mr. Schulz drives a car today.” Now it fits again – the semantic error has been eliminated.
- Runtime errors:These problems occur when the program is runningand cannot be recognized by compilers. They usually lead to the application being terminated. Runtime errors occur with so-called “impossible operations” – for example when trying to divide by zero. They can be found using the debugger .
- Logical error:arithmetic operations are interchanged, which means that the command chain does not make any sense. With the percentage calculation, for example, an addition instead of a multiplication is requested by the program. The problem with this: Neither the debugger nor the compiler can detect a logical error. This is only possible through a detailed program test.
Mutually dependent error patterns
A lexical and syntactic error can, for example, be mutually dependent. After all, a different spelling of a word can lead to a different meaning and is therefore not necessarily recognized as a spelling error. “Car” instead of “Var” is an example of this. This can lead to a semantic error because a variable was not defined as a result. In “bug hunting” one should therefore not only look for one type of error. It should always be checked whether these have also led to other types of problem.