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:
“Still we live meanly, like ants; though the fable tells us that we were long ago changed into men; like pygmies we fight with cranes; it is error upon error, and clout upon clout, and our best virtue has for its occasion a superfluous and evitable wretchedness. Our life is frittered away by detail.”
—Henry David Thoreau (18171862)
“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)
“The Jew is neither a newcomer nor an alien in this country or on this continent; his Americanism is as original and ancient as that of any race or people with the exception of the American Indian and other aborigines. He came in the caravels of Columbus, and he knocked at the gates of New Amsterdam only thirty-five years after the Pilgrim Fathers stepped ashore on Plymouth Rock.”
—Oscar Solomon Straus (18501926)
“Many more children observe attitudes, values and ways different from or in conflict with those of their families, social networks, and institutions. Yet todays young people are no more mature or capable of handling the increased conflicting and often stimulating information they receive than were young people of the past, who received the information and had more adult control of and advice about the information they did receive.”
—James P. Comer (20th century)