IWETHEY v. 0.3.0 | TODO
1,095 registered users | 0 active users | 0 LpH | Statistics
Login | Create New User
IWETHEY Banner

Welcome to IWETHEY!

New But he's saying that you should use both
Throw exceptions when it's a "serious problem" that should halt page execution. Return an error object when it's a "routine event" that can be handled in the calling code and continue.

It seems to me you can do both with exceptions.
===

Purveyor of Doc Hope's [link|http://DocHope.com|fresh-baked dog biscuits and pet treats].
[link|http://DocHope.com|http://DocHope.com]
New My rule of thumb is,
when the return value has an obvious "error mode", such as returning "" for file name (or -1 for collection size), and when the error _must_ be handled by the caller, return a value. If either of those conditions is not met, throw an exception.
--


And what are we doing when the two most powerful nations on earth -- America and Israel -- stomp on the elementary rights of human beings?

-- letter to the editor from W. Ostermeier, Liechtenstein

New Pick one and stick with it.
I'd go with exceptions for the reasons that Robert gave.
Regards,

-scott anderson

"Welcome to Rivendell, Mr. Anderson..."
New You can do both (or more accurately: either) with or without
Exceptions break the normal flow of control (by propagating outward), and should therefore be used when you want to break flow. When you don't want to, use a return value. It's common to see either approach being abused, but it's rarely a deal-breaker.
     Question about exceptions - (drewk) - (31)
         Lots of discussions about that - (FuManChu) - (6)
             That only goes for one kind of exceptions! - (CRConrad) - (1)
                 What does the "checked" mean to you? - (FuManChu)
             But he's saying that you should use both - (drewk) - (3)
                 My rule of thumb is, - (Arkadiy)
                 Pick one and stick with it. - (admin)
                 You can do both (or more accurately: either) with or without - (FuManChu)
         Re: Question about exceptions - (JimWeirich) - (23)
             Nice point about responsibility, but grey areas abound - (FuManChu) - (11)
                 Re: Nice point about responsibility, but grey areas abound - (JimWeirich) - (10)
                     No, we don't - (drewk) - (9)
                         The difference is simple - (ben_tilly) - (8)
                             Problem with that - (drewk) - (4)
                                 See? Whether it is an error IS ambiguous! -NT - (ben_tilly) - (2)
                                     I think I know what to do then - (drewk) - (1)
                                         Exactly -NT - (ben_tilly)
                                 Re: Problem with that - (JimWeirich)
                             Thats the sort of logic that makes me wary of exceptions. - (static) - (2)
                                 Exceptions are one form of Continuation - (ChrisR) - (1)
                                     Icon's generators rely on the failure model. - (static)
             Disabling assertions - (ChrisR) - (3)
                 That's one of the points he raised - (drewk) - (2)
                     Expense is relative - (ChrisR)
                     Re: That's one of the points he raised - (JayMehaffey)
             DbC? -NT - (drewk) - (6)
                 Design by Contract - (Yendor) - (5)
                     Not the same thing. - (admin) - (4)
                         That's not strictly Eiffel; - (jake123) - (3)
                             It's built into Eiffel - (admin)
                             It is DESIGN by Contract after all - (JimWeirich) - (1)
                                 As you say - (jake123)

Cruisin' fer burgers in Daddy's new car...
59 ms