Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.programmer > #18776
| From | Robert Klemme <shortcutter@googlemail.com> |
|---|---|
| Newsgroups | comp.lang.java.programmer |
| Subject | Re: can't throw |
| Date | 2012-09-14 23:07 +0200 |
| Message-ID | <abhkjtFfcjaU1@mid.individual.net> (permalink) |
| References | (5 earlier) <50510bbc$0$281$14726298@news.sunsite.dk> <h7kuo77qjaim$.vgolgvvfs7kc.dlg@40tude.net> <ion658l9c0jpn2v239660jlctjqdath7bb@4ax.com> <abhck3Fdgb0U1@mid.individual.net> <hs3758lo2hrs884cagclm2lh72ijc1mk9b@4ax.com> |
On 14.09.2012 22:16, Gene Wirchenko wrote: > On Fri, 14 Sep 2012 20:50:38 +0200, Robert Klemme > <shortcutter@googlemail.com> wrote: > >> On 14.09.2012 18:49, Gene Wirchenko wrote: >> >>> It may not be nearly as elegant, but I still prefer BASIC's ON >>> ERROR GOTO handling. Yes, one had to sort through the error numbers, >>> but that made it easier in some ways. One could code something to >>> handle the few cases where there was a specific handling and then use >>> a catch-all for the rest. >> >> Well, you can do _that_ in Java, too. > > I am not surprised. Unfortunately, I never learned that. > Beginning Java texts that I have seen do not cover it. With BASIC, > handling errors was with only one error handler so it was forced to do > it that way (and sometimes, it was covered). I wasn't aware that this seems to be such a mystery. The basic (!) mechanism is pretty simple: exception handler order matters: the first matching handler is used. So you can place handlers for classes down the exception inheritance hierarchy at the front and place handlers for classes further up later. In an extreme case use a catch block with RuntimeException, Exception or Throwable as last one. >> I find the distinction between checked and unchecked exceptions pretty >> good - although the distribution of exception types across these >> categories does not always seem to be wisely made in the standard library. > > Java has too many distinctions that are not easily (or > often-enough) made and that can catch Java newbies. > > Maybe, it was too much of trying to be everything to everybody? I believe what you describe is rather an effect of the massive success the language has had. That success a) led to a prolonged life and b) steered more resources into the development of the language, libraries and frameworks. For another language people might not have bothered to write another IO library. Now there are is more than one around to maintain compatibility and that makes the language look inconsistent - even though it's just history showing. Same story with Vector and ArrayList or synchronized vs. java.util.concurrent.locks (where one is really a language feature and the other a library) or Date vs. Calendar. As Lew said, you need darn good library designers to get it right the first time. But at least you can see that newer parts of the library are better than older parts. I find that good even though it increases the volume of library API to learn. Cheers robert -- remember.guy do |as, often| as.you_can - without end http://blog.rubybestpractices.com/
Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
can't throw bob smith <bob@coolfone.comze.com> - 2012-09-11 13:16 -0700
Re: can't throw markspace <-@.> - 2012-09-11 13:34 -0700
Re: can't throw Lew <lewbloch@gmail.com> - 2012-09-11 14:15 -0700
Re: can't throw Eric Sosman <esosman@ieee-dot-org.invalid> - 2012-09-11 17:02 -0400
Re: can't throw Lew <lewbloch@gmail.com> - 2012-09-11 14:17 -0700
Re: can't throw Arne Vajhøj <arne@vajhoej.dk> - 2012-09-11 21:21 -0400
Re: can't throw Peter Duniho <NpOeStPeAdM@NnOwSlPiAnMk.com> - 2012-09-11 21:59 -0700
Re: can't throw Gene Wirchenko <genew@ocis.net> - 2012-09-12 09:18 -0700
Re: can't throw Robert Klemme <shortcutter@googlemail.com> - 2012-09-12 19:09 +0200
Re: can't throw markspace <-@.> - 2012-09-12 10:56 -0700
Re: can't throw Arne Vajhøj <arne@vajhoej.dk> - 2012-09-12 18:36 -0400
Re: can't throw Gene Wirchenko <genew@ocis.net> - 2012-09-12 18:29 -0700
Re: can't throw Patricia Shanahan <pats@acm.org> - 2012-09-12 18:34 -0700
Re: can't throw Arne Vajhøj <arne@vajhoej.dk> - 2012-09-12 21:37 -0400
Re: can't throw Arne Vajhøj <arne@vajhoej.dk> - 2012-09-12 21:54 -0400
Re: can't throw Jim Janney <jjanney@shell.xmission.com> - 2012-09-12 11:27 -0600
Re: can't throw Arne Vajhøj <arne@vajhoej.dk> - 2012-09-12 18:24 -0400
Re: can't throw Peter Duniho <NpOeStPeAdM@NnOwSlPiAnMk.com> - 2012-09-13 22:20 -0700
Re: can't throw Gene Wirchenko <genew@ocis.net> - 2012-09-14 09:49 -0700
Re: can't throw Robert Klemme <shortcutter@googlemail.com> - 2012-09-14 20:50 +0200
Re: can't throw Lew <lewbloch@gmail.com> - 2012-09-14 13:02 -0700
Re: can't throw Gene Wirchenko <genew@ocis.net> - 2012-09-14 14:06 -0700
Re: can't throw Gene Wirchenko <genew@ocis.net> - 2012-09-14 13:16 -0700
Re: can't throw Robert Klemme <shortcutter@googlemail.com> - 2012-09-14 23:07 +0200
Re: can't throw Lew <lewbloch@gmail.com> - 2012-09-14 14:28 -0700
Re: can't throw Gene Wirchenko <genew@ocis.net> - 2012-09-16 20:04 -0700
Re: can't throw Arne Vajhøj <arne@vajhoej.dk> - 2012-09-12 18:16 -0400
Re: can't throw Lew <lewbloch@gmail.com> - 2012-09-12 23:15 -0700
Re: can't throw Leif Roar Moldskred <leifm@dimnakorr.com> - 2012-09-14 17:33 -0500
Re: can't throw Robert Klemme <shortcutter@googlemail.com> - 2012-09-16 15:46 +0200
Re: can't throw Leif Roar Moldskred <leifm@dimnakorr.com> - 2012-09-16 12:17 -0500
Re: can't throw Robert Klemme <shortcutter@googlemail.com> - 2012-09-16 22:36 +0200
Re: can't throw Gene Wirchenko <genew@ocis.net> - 2012-09-16 20:07 -0700
Re: can't throw Robert Klemme <shortcutter@googlemail.com> - 2012-09-17 07:41 +0200
Re: can't throw Gene Wirchenko <genew@ocis.net> - 2012-09-17 09:51 -0700
Re: can't throw Robert Klemme <shortcutter@googlemail.com> - 2012-09-17 21:00 +0200
Re: can't throw Gene Wirchenko <genew@ocis.net> - 2012-09-17 13:23 -0700
Re: can't throw Joerg Meier <joergmmeier@arcor.de> - 2012-09-17 18:52 +0200
Re: can't throw Lew <lewbloch@gmail.com> - 2012-09-17 11:22 -0700
Re: can't throw Leif Roar Moldskred <leifm@dimnakorr.com> - 2012-09-17 02:52 -0500
Re: can't throw Leif Roar Moldskred <leifm@dimnakorr.com> - 2012-09-17 02:39 -0500
Re: can't throw Robert Klemme <shortcutter@googlemail.com> - 2012-09-17 21:02 +0200
Re: can't throw markspace <-@.> - 2012-09-11 14:28 -0700
Re: can't throw Arne Vajhøj <arne@vajhoej.dk> - 2012-09-11 21:14 -0400
Re: can't throw Arne Vajhøj <arne@vajhoej.dk> - 2012-09-12 18:11 -0400
Re: can't throw Robert Klemme <shortcutter@googlemail.com> - 2012-09-12 08:31 +0200
Re: can't throw bob smith <bob@coolfone.comze.com> - 2012-09-12 11:40 -0700
Re: can't throw Eric Sosman <esosman@ieee-dot-org.invalid> - 2012-09-12 15:50 -0400
Re: can't throw Lew <lewbloch@gmail.com> - 2012-09-12 12:52 -0700
Re: can't throw Robert Klemme <shortcutter@googlemail.com> - 2012-09-12 23:24 +0200
Re: can't throw Daniel Pitts <newsgroup.nospam@virtualinfinity.net> - 2012-09-12 15:10 -0700
Re: can't throw Robert Klemme <shortcutter@googlemail.com> - 2012-09-13 23:32 +0200
Re: can't throw Arne Vajhøj <arne@vajhoej.dk> - 2012-09-12 18:06 -0400
Re: can't throw Roedy Green <see_website@mindprod.com.invalid> - 2012-09-12 20:55 -0700
csiph-web