Path: csiph.com!usenet.pasdenom.info!gegeweb.org!eternal-september.org!feeder.eternal-september.org!mx04.eternal-september.org!.POSTED!not-for-mail From: Gene Wirchenko Newsgroups: comp.lang.java.programmer Subject: Re: can't throw Date: Wed, 12 Sep 2012 09:18:12 -0700 Organization: A noiseless patient Spider Lines: 42 Message-ID: References: <19af6b94-7a1e-4491-afb2-79782406f560@googlegroups.com> <504fe3a6$0$293$14726298@news.sunsite.dk> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit Injection-Info: mx04.eternal-september.org; posting-host="c0a6a1dc41fc92eb7000e57afbd16211"; logging-data="13079"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+FJEM6z1Lec3JPcYwqNPBlbeOQ8ygn2nk=" X-Newsreader: Forte Agent 4.2/32.1118 Cancel-Lock: sha1:9VHLyDUrGdoQWdeuduo3NoWDbnk= Xref: csiph.com comp.lang.java.programmer:18676 On Tue, 11 Sep 2012 21:59:16 -0700, Peter Duniho wrote: >On Tue, 11 Sep 2012 21:21:38 -0400, Arne Vajhøj wrote: > >> [...] >> But given that languages invented after Java chose not to >> implement checked exceptions, then we must conclude that >> it has not caught on. >> >> (primarily thinking of C# and Scala here) >> >> So the benefits are not that obvious to everyone. > >And more to the point, those other languages do not seem to suffer greatly, >if at all, from the lack of checked exceptions. > >For whatever reason, I've never found checked exceptions a compelling >feature. It's absolutely in the right spirit, one which I agree >wholeheartedly with. And yet I find that at least in the Java >implementation, it seems to create more headaches than it prevents. To me, it also seems as if it would be a good idea, but using it is awkward. In some coursework, I used a Java cryptographic system. It had a lot of exceptions to handle so my code had a lot of catches. Because I did not know what was thrown, I wrote my code without them and then added whatever the compiler stated was missing. In those catches, there really was not anything that I could do other than reporting the error. I prefer reading the main flow of execution as a high-level story. Catches interrupt this. When there are a lot of catches, they make the main code harder to find. >I realize I'm in the minority here. But it's a viewpoint I feel needs to >be expressed. Thank you. Sincerely, Gene Wirchenko