Compile time errors indicate syntax errors, and other violation we might do while coding. This would just stop the compiler from generating proper binaries for us.
Run time errors occur during execution of program. Run time errors indicate bugs in program. We can consider running out of memory as runtime error.
Each and every time we write a code, that is verified by the compiler generated syntax & semantics tree. Which part does not match with the tree, compiler throws an error.... This is known as compilation time error / syntactic error.
The runtime errors are the errors, which are generated by the environment, or the logical errors as divided by zero error. The runtime errors, which are generated by the operating system, are like Lvalue required or memory allocation errors.
If you have more quarries then I recommend you to go through any Compiler design books as book by Aho, Ulman etc.
I disagree. Crashing is like any other programming bug caused by the programmer writing something that is syntactically correct, but violates some logical rule such as dereferencing a NULL pointer (a very simple example).
The only difference between crashing and not crashing is that the user is aware of the problem immediately and may loose data, whereas in the latter case, they are unaware of the problem and may get corrupted data.
Personally, I prefer crashing as to not (at least when I am debugging ;)) as it tells me immediately that I’ve done something wrong.
Each and every time we write a code, that is verified by the compiler generated syntax & semantics tree. Which part does not match with the tree, compiler throws an error.... This is known as compilation time error / syntactic error.
A bit technical but essentially correct.
Originally posted by nearestniladri2 003
The runtime errors are the errors, which are generated by the environment, or the logical errors as divided by zero error.
Correct.
Originally posted by nearestniladri2 003
The runtime errors, which are generated by the operating system, are like Lvalue required or memory allocation errors.
Lvalue required is a compile time error. But you are right in that memory allocation is a runtime error.
Basically, anything that gets through the compile and results in a programme not behaving as expected is a runtime error. Depending on its severity, the user may see nothing apparently wrong, see it crash, or may even see the words “runtime error” or other phrase indicating that the framework in the code generated was able to catch the problem just in time to emit some message.
Further, a failed assertion is also considered a runtime error. They give you some info as to what just happened. Unfortunately, sometime they don’t give you enough context.
I disagree. Crashing is like any other programming bug caused by the programmer writing something that is syntactically correct, but violates some logical rule such as dereferencing a NULL pointer (a very simple example).
The only difference between crashing and not crashing is that the user is aware of the problem immediately and may loose data, whereas in the latter case, they are unaware of the problem and may get corrupted data.
Personally, I prefer crashing as to not (at least when I am debugging ;)) as it tells me immediately that I’ve done something wrong.
Adrian
The difference between [font=Verdana][size=2]runtime errors and crashes is that we can often recover gracefully from a runtime error.[/size][/font]
[font=Verdana][size=2]There is one category of error called Bomb.[/size][/font]
[font=Verdana][size=2]The term bomb usually refers to a program hanging or ending prematurely. Bombing refers to a single program, whereas crashing refers to the entire system. [/size][/font]
The difference between [font=Verdana][size=2]runtime errors and crashes is that we can often recover gracefully from a runtime error.[/size][/font]
[font=Verdana][size=2]There is one category of error called Bomb.[/size][/font]
[font=Verdana][size=2]The term bomb usually refers to a program hanging or ending prematurely. Bombing refers to a single program, whereas crashing refers to the entire system. [/size][/font]
Err, the tags on this forum are not equivalent to html tags. ;)
I also still do not completely agree with your statement. Though there may be different classifications of runtime errors; a runtime error is generally just what is describes, an error occurring at runtime, be it a crash, a bug, or something that is exceptional (see exception handling). Catching a runtime error may be possible for a graceful recovery, but is not mandatory.
Further, if the ‘error’ is caught and fixed, it may not be considered an error in the same sense, as you have created a valid state for it by providing a recovery (probably why C++ uses the term exception handling not error handling).
Comment