Compiler versus Runtime Errors
Oh, how we love’em!
Errors are what make programmers, programmers; and what make non-programmers, quit!
We’ve all been there… What. I don’t understand. It doesn’t make sense. Throws up hands, and maybe flip a keyboard, chair, or table.
We can start with the beginning. The first error, we typically encounter is a compilation error. Also known as a syntax error, this error prevents the application from ever executing and fails during the compilation of the application. The compiling process, also known as the building process, tries to translate the programming language code down to system code to prepare the application to be executed either by a system or user. Some of our most common errors are the notorious semi-colon “;”. Typically, we just forget to add it at the end of the line. Another one is the closing curly-bracket ‘}’. Often times, curly-brackets are nested and in haste, we forget to appropriately close it out.
See if you notice the error above. It’s pretty straight forward, but very common. Now most IDEs provide hints to help prevent and minimize compiler errors.
Once you get pass the syntax error, there’s a chance your application fails or blows-up due to an error once it gets pass compiling and attempts to actually run. These errors are called, runtime errors. These errors are typically due to upper and lower bounds, type casting, or situations that are not always easy to detect by programmer or compiler.
Do you see the error? Again, the syntax all looks good but the request that is being requested.
Lastly, I’ll briefly touch on the infamous Logic Error, because it is extremely common version of a run-time error, but requires extra testing and evaluation. The code compiles, it runs fine, but the output is not what you expect. Here’s an example below.
As I come across some additional common errors, I’ll start to add entries for those as well.
Let me know your thoughts, and share some of your favorite errors.