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:
“In Pride, in reasning Pride, our error lies;
All quit their sphere, and rush into the skies.
Pride still is aiming at the blest abodes,
Men would be Angels, Angels would be Gods.”
—Alexander Pope (16881744)
“We must trust infinitely to the beneficent necessity which shines through all laws. Human nature expresses itself in them as characteristically as in statues, or songs, or railroads, and an abstract of the codes of nations would be an abstract of the common conscience.”
—Ralph Waldo Emerson (18031882)
“For a parent, its hard to recognize the significance of your work when youre immersed in the mundane details. Few of us, as we run the bath water or spread the peanut butter on the bread, proclaim proudly, Im making my contribution to the future of the planet. But with the exception of global hunger, few jobs in the world of paychecks and promotions compare in significance to the job of parent.”
—Joyce Maynard (20th century)
“Mothers risk alienating their mates if they expect them to hold or care for the baby exactly as they do. Fathers who are constantly criticized or corrected may lose interest in handling the baby, and this is a loss for everyone. The cycle is a dangerous one. Now the same mother feels bitter because she is no longer getting any help at home.”
—Cathy Rindner Tempelsman (20th century)