What’s a logical fallacy?

Print anything with Printful



A logic error in programming is a mistake that is not easily identified and can result in incorrect output. These errors can be caused by syntax or bad data, and may not be detected by the programming language interpreter. To find and fix these errors, a programmer must methodically trace the source of the problem. Logic errors are not limited to programming and can also occur in communication or other areas. Spell checkers are an example of a tool that can have logical errors.

A logic error is a problem with a computer’s programming code that isn’t easily identified when the code is written or compiled. Sometimes called a semantic error, a logical error is usually the fault of the programmer; even if the encoding is correct, the resulting answer may still be incorrect. If the programming language compiler ships with a logic error, it will correctly interpret the supplied code, resulting in a working program that may return incorrect data.

Logic errors are difficult for the programmer to detect because the programming language interpreter does not identify this error as a problem. After the code has been successfully executed, the results, without deliberate scrutiny, may initially appear to be correct. To identify these types of errors, a person familiar with the expected results and function of the program should review the output and operation of that program.

To find a logical error in your code, you need to be able to methodically trace the source of the error. The error could be the result of incorrectly encoded syntax. The syntax of the code might look correct but it could cause a logic error. These types of errors could become very costly problems if not corrected in a timely manner.

Logic errors can also arise from bad data that has been used by a properly written program with no internal logic errors of its own. This is equivalent to the common expression “garbage in, garbage out”. If data is entered incorrectly into the program, even if the program runs successfully, the result is an error than expected.

As an example of another type of logic fallacy, while at a stop sign, a driver might choose to turn right or turn left. If the driver turns right when the intended destination was on the left, this would be considered a logic error. Technically, the driver drove the vehicle correctly, but the end result was not as expected. As this example illustrates, errors in logic aren’t limited to the realm of computer programming. A logic error could also be classified as a communications error.

In another example where there are logical errors, word processors might sometimes use an automatic spell checker; these spell checkers are notorious for lacking logical errors. For example, the noun “sale” could be misread as the noun “sail” in a sentence. Each word is spelled correctly, sounds correct, and may be grammatically correct within the sentence, but the definition of a word may not fit the context of the particular sentence.




Protect your devices with Threat Protection by NordVPN


Skip to content