How is average "java joe" suppose to get checked exceptions right if there is this much confusion around the proper usage?
2011/3/25 Cédric Beust ♔ <ced...@beust.com> > > > On Fri, Mar 25, 2011 at 3:14 AM, mP <miroslav.poko...@gmail.com> wrote: > >> >> RemoteException // probably the most famous this should be >> unchecked exception >> > > I disagree. RemoteException (and network exceptions in general) should be > checked exceptions. > > It's one of the things we learned from the seminal paper "A note on > distributed > computing"<http://www.google.com/url?sa=t&source=web&cd=1&ved=0CBoQFjAA&url=http%3A%2F%2Fciteseerx.ist.psu.edu%2Fviewdoc%2Fdownload%3Fdoi%3D10.1.1.48.7969%26rep%3Drep1%26type%3Dpdf&rct=j&q=note%20distributed%20computing&ei=E-qMTYz6C4GosAPK6P2HCQ&usg=AFQjCNHGoeDsB773Zr-y7-kNiXpHKek0KQ&sig2=Nw6f57iV0vtWVLyHC1be9Q> > (PDF): > remote operations need to be clearly separated from local operations, and > the only robust way to do this is by enforcing the handling of errors > statically. If you're invoking a method and the invocation operation itself > (not the method) can fail, you need to handle it. > > > >> EOFException // checkness should be the same as IOException. >> >> Perhaps just perhaps the problem is that heirarchy is both a grouping >> mechanism and a way to define checkness. Therefore if a marker was applied >> to an exception to denote whether it (the exception) was checked or >> unchecked ignoring whether it extended exception/runtime etc perhaps things >> would be better and more flexible. > > > Yes, although all you need to achieve this goal is two different > hierarchies, which we already have. It's just a pity that such a huge chunk > of the inheritance tree belongs to the "checked" side. > > An interesting idea that came out of last time we had this discussion was > that the same exception could be checked or unchecked depending on where > it's being used. The call site is obviously not the right place to do that, > but the throw site might be. I'm still undecided on this whole idea. > > -- > Cédric > > > > -- > You received this message because you are subscribed to the Google Groups > "The Java Posse" group. > To post to this group, send email to javaposse@googlegroups.com. > To unsubscribe from this group, send email to > javaposse+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/javaposse?hl=en. > -- You received this message because you are subscribed to the Google Groups "The Java Posse" group. To post to this group, send email to javaposse@googlegroups.com. To unsubscribe from this group, send email to javaposse+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/javaposse?hl=en.