Citation:
The terms, error and exception, are often used interchangeably. In fact, an error, which is an event that happens during the execution of code, interrupts or disrupts the code's normal flow and creates an exception object. When an error interrupts the flow, the program tries to find an exception handler — a block of code that tells it how to react — that will help it resume the flow. In other words, an error is the event; an exception is the object that the event creates.
Programmers use the phrase "throwing an exception" to mean that the method in question encountered an error and reacted by creating an exception object that contains information about the error and when/where it occurred. Factors that cause errors and subsequent exceptions include user error, resource failures, and failures of programming logic. Such errors are related to how the code undertakes a specific task; they are not related to the purpose of the task.
For the purpose of this article, "exception handling" means interpreting and reacting to the exceptions created by errors.
Extrait de l'article suivant ou on te dira exactement quand utiliser une structure de controle (If, For...) et quand utiliser une exeption
Citation:
Although structured exception handling is useful, you should use it exclusively for exceptions. An exception is not necessarily an error, but it should be something that happens infrequently and is not expected in normal operation. Throwing exceptions takes more processing time than testing and branching, for example using a Select construction or a While loop. Exceptions also make your code harder to read when used for normal flow control. You should not use them as a way of branching or returning values.
extrait de l'article pour l'amelioration des perfs de .net que je copnseille a tous: