tag:blogger.com,1999:blog-6541636783175030762.post7448266027272599917..comments2023-09-01T15:45:50.529-04:00Comments on Coding Cramp: Why you should not throw Exceptions for normal Business FlowAnonymoushttp://www.blogger.com/profile/09056136569752231442noreply@blogger.comBlogger2125tag:blogger.com,1999:blog-6541636783175030762.post-82886087777013962222011-07-07T23:05:21.466-04:002011-07-07T23:05:21.466-04:00The reason for exceptions is not because it is too...The reason for exceptions is not because it is too easy to forget to check return values. Even on MSDN it states that exceptions exist so your program can communicate unexpected events to a higher execution context that is better able to recover from abnormal events. <br /><br />I should have expressed myself better that throwing an exception is 4 orders of magnitude slower than setting a return value and returning. 4 orders of magnitude on any process is a concern where any volume of transactions is involved.<br /><br />I stand firmly that exceptions are to be used for exception processing, not for normal business logic.<br /><br />Reference: http://msdn.microsoft.com/en-us/library/6dekhbbc(v=vs.80).aspxAnonymoushttps://www.blogger.com/profile/09056136569752231442noreply@blogger.comtag:blogger.com,1999:blog-6541636783175030762.post-65631497233280131462011-07-07T12:46:16.235-04:002011-07-07T12:46:16.235-04:00This is such wrong advise. The whole reason to th...This is such wrong advise. The whole reason to thrown an exception is that its too easy to forget to check return values. Nevermind that a method might ligitimately be allowed to return null, but might have to thrown an exception because it couldn't do its job. <br /><br />Seven seconds? Really, who cares?Anonymousnoreply@blogger.com