Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #18776

Re: can't throw

Path csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!news.musoftware.de!wum.musoftware.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From Robert Klemme <shortcutter@googlemail.com>
Newsgroups comp.lang.java.programmer
Subject Re: can't throw
Date Fri, 14 Sep 2012 23:07:05 +0200
Lines 56
Message-ID <abhkjtFfcjaU1@mid.individual.net> (permalink)
References <19af6b94-7a1e-4491-afb2-79782406f560@googlegroups.com> <k2o8sm$ve3$1@dont-email.me> <fea53dab-0659-4f9f-af44-c181c4508aa1@googlegroups.com> <504fe3a6$0$293$14726298@news.sunsite.dk> <zy7f3qajj0sa.u9hsothk0nnw$.dlg@40tude.net> <50510bbc$0$281$14726298@news.sunsite.dk> <h7kuo77qjaim$.vgolgvvfs7kc.dlg@40tude.net> <ion658l9c0jpn2v239660jlctjqdath7bb@4ax.com> <abhck3Fdgb0U1@mid.individual.net> <hs3758lo2hrs884cagclm2lh72ijc1mk9b@4ax.com>
Mime-Version 1.0
Content-Type text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding 7bit
X-Trace individual.net 97lywr5cpfR3BYJhVUsajwVl0hLyMyDKb1kBYl6YkKTa3wYAvSNDwq3fBfZ56uQk4=
Cancel-Lock sha1:9rGnHDP9hTcuehQ93J3l5MvNxpE=
User-Agent Mozilla/5.0 (Windows NT 6.0; WOW64; rv:15.0) Gecko/20120907 Thunderbird/15.0.1
In-Reply-To <hs3758lo2hrs884cagclm2lh72ijc1mk9b@4ax.com>
Xref csiph.com comp.lang.java.programmer:18776

Show key headers only | View raw


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 | NextPrevious in thread | Next in thread | Find similar | Unroll thread


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