Error Code - Error Codes and Exception Handling

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:

    Error is a supposition that pleasure and pain, that intelligence, substance, life, are existent in matter. Error is neither Mind nor one of Mind’s faculties. Error is the contradiction of Truth. Error is a belief without understanding. Error is unreal because untrue. It is that which seemeth to be and is not. If error were true, its truth would be error, and we should have a self-evident absurdity—namely, erroneous truth. Thus we should continue to lose the standard of Truth.
    Mary Baker Eddy (1821–1910)

    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 (1788–1824)

    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 (1850–1926)

    Madam, a circulating library in a town is as an evergreen tree of diabolical knowledge; it blossoms through the year. And depend on it ... that they who are so fond of handling the leaves, will long for the fruit at last.
    Richard Brinsley Sheridan (1751–1816)