Common Programming errors

1. Introduction

The greatest enemy in programming to all programmers is getting errors, and everyone has experienced getting errors when they run the code. Even the well-experienced programmer is still facing an error. Programming is a tricky and delicate thing to do when you need to be more careful.

2. What are considered common programming errors?

In the good old days, way before our understanding of programming and coding as it is today, getting errors could be truly disastrous. Good thing for us that all modern coding approaches and debugging systems make it a lot easier for us to fix these errors whenever we get one. Seven common programming errors are encountered frequently in programming. They are Runtime errors, Logic errors, Compilation errors, Syntax errors, Interface errors, Interface errors, and Arithmetic errors.

2.1. Runtime errors

Runtime errors are coding errors that show themselves when a user tries to run the program. It got an error because something confused the program and caused it to crash. Runtime errors are also known as execution errors.

2.2. Logic errors

Logical errors can be extremely frustrating since everything is fine with the code. They are the most difficult to fix because the program runs without crashing but outputs the incorrect result. The programmer didn’t type the code as he intended, so the program output the result that the programmer didn’t want.

2.3. Syntax errors

Syntax errors have their own specialized rules, and when these rules are not followed and the programmer runs the code, a syntax error prevents the program from running. Python will find this error and exit your program without running anything. They are analogous to spelling or grammar mistakes like in English: “Have you the movie? “Which doesn’t make sense and missing a verb. Some of the standard Python syntax errors are

Syntax, Runtime, and Logical Errors in Python

2.4. Compilation errors

This error usually occurs when the code is built, but the program is failed to compile. If the code doesn’t compile, the program can’t be executed. The same as Logic errors and compile-time errors are a source of frustration to developers, especially when they have just started learning the language. Unlike Logic errors, you do get the error messages, but they are unclear and don’t mean anything useful.

2.5. Interface errors

Most of the time, the program follows standards. If inputting of your program doesn’t conform to standards, you might get an interface error. These errors occur when there is a disconnection between what the programmer meant to be used and how it is used. An interface error might happen when you have an API that needs that specific parameter to be set, but those parameters are not established.

2.6. Resource errors

A program can force the computer it’s running to attempt to allocate more processor power, ram, disk space, etc., than it has, which leads the program to crash or be bugged. Usually, the computer your program is running will allocate a certain number of resources. Still, sometimes your code forces the computer to try and allocate more resources than it has, resulting in resource errors.

2.7. Arithmetic errors

Arithmetic errors are just like logic errors but with mathematics. For example, some division equations may require the program to divide by 0, which is mathematically impossible. It results in an error that prevents the software from running correctly. As mentioned, arithmetic errors can generate logic or sometimes even runtime errors in the case of dividing by 0. To stop that, having functional tests that include edge cases like 0 or negative numbers is an excellent way to prevent these errors.

3. Conclusion

Ultimately, we can’t escape from errors as long as we continue programming. At some point, it is better to know these types of mistakes in advance so that when it appears in the future, you might learn a thing or two about them and can identify what type of error is, which saves you time looking through everything on the internet. These are the seven most common errors in programming languages and their examples.

--

--

Seattle Website Developer

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store