Have you ever used a program and come across a totally bizarre error message? For example, have you ever seen an error message like this one?
Of course, the event did happen, and the user is very puzzled by such a message. In fact, the user can do absolutely nothing in response to this error message except panic.
The problem with this error message is that it isn't intended for the user. Rather, it was intended for the programmer to debug a problem and unfortunately was left in the release version of the program. There are four ways to prevent this problem:
This observation makes the converse of my conclusion in the last section true. Error messages are not assertions or TRACE statements and should also not be used as a substitute.
TIP
Don't use error messages as a substitute for assertions or TRACE statements.