It is always better to specifically match, rather than assume that this is a "USER DOES NOT EXIST" based on the trap of a failed match.
It is always a bad practice to try / catch / learn. If you are going to catch an exception, write it down or throw it.
You did not specify a language, so suppose C # is int.TryParse()much cleaner than int.Parseinside a try/catch.
source
share