Skip to content

Instantly share code, notes, and snippets.

@allenatwork
Created August 30, 2017 04:04
Show Gist options
  • Save allenatwork/62c379041bb80e27bef28af6f5ca9dab to your computer and use it in GitHub Desktop.
Save allenatwork/62c379041bb80e27bef28af6f5ca9dab to your computer and use it in GitHub Desktop.
Try - Catch
Exceptions are EXPENSIVE! A stack trace must be created (if used, eg logged etc) and special flow control handled
Exceptions should not be used for flow control - Exceptions are for the "exceptional"
Exceptions are the code's way of saying "I can't handle this situation and I'm giving up... you deal with it!", but here you can handle it... so handle it
-> use check is faster
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment