by highCs on 6/16/16, 9:53 PM with 5 comments
by viraptor on 6/16/16, 10:18 PM
What's the alternative in your opinion? Let's say you're trying to open a file. It can fail. You've got to check this.
by gt2 on 6/17/16, 5:36 PM
Also, consider that if the entire block isn't wrapped in a try/catch, those ifs are guarding against runtime errors which would crash the program for the user.
Although I do see unit tests making use of exceptions in their decision to pass/fail, it's not the only way to write a unit test-- sometimes you test for value, etc.
by bbcbasic on 6/19/16, 10:10 AM
I have seen code that catches any exception and returns false. That is annoying although for different reasons.
by GFK_of_xmaspast on 6/16/16, 10:11 PM
by liveoneggs on 6/17/16, 12:55 AM