Error Codes and Exception Handling
Error codes are slowly disappearing from the programmer's environment as modern object-oriented programming languages replace them with exceptions. Exceptions have the advantage of being handled with explicit blocks of code, separate from the rest of the code. While it is considered poor practice in methodologies that use error codes and return codes to indicate failure, programmers often neglect to check return values for error conditions. That negligence can cause undesirable effects, as ignored error conditions often cause more severe problems later in the program. Exceptions are implemented in such a way as to separate the error handling code from the rest of the code. Separating the error handling code from the normal logic makes programs easier to write and understand, since one block of error handling code can service errors from any number of function calls. Exception handling also makes the code more readable than implementations with error codes, since exception handling does not disrupt the flow of the code with frequent checks for error conditions.
Read more about this topic: Error Code
Famous quotes containing the words error, codes, exception and/or handling:
“Knowledge, like matter, [my father] would affirm, was divisible in infinitum;Mthat the grains and scruples were as much a part of it, as the gravitation of the whole world.In a word, he would say, error was error,no matter where it fell,whether in a fraction,or a pound,twas alike fatal to truth.”
—Laurence Sterne (17131768)
“I cannot help thinking that the menace of Hell makes as many devils as the severe penal codes of inhuman humanity make villains.”
—George Gordon Noel Byron (17881824)
“There are two great rules in life, the one general and the other particular. The first is that every one can in the end get what he wants if he only tries. This is the general rule. The particular rule is that every individual is more or less of an exception to the general rule.”
—Samuel Butler (18351902)
“That a good fit between parental handling and child temperament is vital to help children adapt to the imperatives of their society is a crucial concept that can be applied to other cultures.”
—Stella Chess (20th century)