|
Share this post! |
| Vote this! |
|
- Exceptions are exceptional and should be treated as such. If something exceptional, unusual, or generally "not supposed to ordinarily happen" then an exception is a reasonable thing to do.
- You shouldn't throw exceptions for things that happen all the time. Then they'd be "ordinaries".
- If your functions are named well, using verbs (actions) and nouns (stuff to take action on) then throw an exception if your method can't do what it says it can.
- For example, SaveBook(). If it can't save the book - it can't do what it promised - then throw an exception. That might be for a number of reasons.
More...
Highly
Recommended Reading After Above
Programming
0 comments:
Post a Comment