January 2011
Intermediate to advanced
224 pages
5h 43m
English
In most of the example programs so far, I either noted that they expected their input to be valid or ignored the possibility of problematic input altogether. There are situations in which we can get away with this, such as when a program is only for our own use or when we can be positively certain that there will be no unexpected input. In serious programs, however, some kind of disaster plan is usually needed.
The problematic situations that a program can encounter can roughly be divided into two categories: programmer mistakes and run-time problems. If someone forgets to pass a required argument to a function, that is a programmer mistake. On the other hand, if a program asks the user to enter a name ...