On Aug 21, 2:33 pm, Casper Bang <[email protected]> wrote: > However exceptions are meant > to be used for exceptional cases and not a replacement for proper > factored condition checking down the primary path.
Oh, this is a very good point! - I see that both can make sense depending of the case - if a method checks some state or is really running into an error. Thanks for pointing that out! > Another problem > with Joel's view is that of context, if you can only signal an error > code, you'll have to resort to some shared/mutable place for further > context. I think the problem of context you also have when dealing with an exception on the low level. Context is known most likely only by some parent caller but on the other hand the parent caller often does not have any clue about how some functionality has been implemented on the low level and hence either does not really know what happens. The parent just can say that "the operation failed, try again" - which is often a good option for displaying to the user (my applications used to return a lot of information to allow quickly locating the core issue, however that was too overwhelming for the user and so I created the simple AND detailed information offering the details at click). To combine simple and detailed information (linked together) often did not work well for me in the past when processing multiple items with inner complexity due to using different other 3rd party libraries and so on. Finding the right context in error/warning case is a challenge in general I think - with or without exceptions and no matter which language used. > Well they force you to acknowledge them, but they don't really do > anything else and as such can provide a false sense of security (can > be swallowed or logged). Indeed, however it has a little more "reminder-character" with the checked exceptions. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "The Java Posse" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/javaposse?hl=en -~----------~----~----~----~------~----~------~--~---
