From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,98c463a9e98cfdf5 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-06-13 11:37:11 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!bloom-beacon.mit.edu!ra.nrl.navy.mil!dca6-feed2.news.algx.net!allegiance!newsfeed1.cidera.com!Cidera!cyclone.socal.rr.com!cyclone3.kc.rr.com!news3.kc.rr.com!twister.socal.rr.com.POSTED!not-for-mail Message-ID: <3D08E672.39F64AE4@san.rr.com> From: Darren New X-Mailer: Mozilla 4.77 [en] (Windows NT 5.0; U) X-Accept-Language: en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Ada exceptions. unchecked? References: <8db3d6c8.0206112300.3965a62b@posting.google.com> <3D0750F1.7A12342@raytheon.com> <$4ctS45vG2pB@eisner.encompasserve.org> <3D0771D3.FFEA1AA4@san.rr.com> <3D08ADF9.7040104@mail.com> <3D08CB6F.D68F18DE@san.rr.com> <3D08D2AA.1020502@mail.com> <3D08DAFC.D6BB2ECC@san.rr.com> <3D08DF3F.5080800@mail.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Date: Thu, 13 Jun 2002 18:37:11 GMT NNTP-Posting-Host: 66.75.151.160 X-Complaints-To: abuse@rr.com X-Trace: twister.socal.rr.com 1023993431 66.75.151.160 (Thu, 13 Jun 2002 11:37:11 PDT) NNTP-Posting-Date: Thu, 13 Jun 2002 11:37:11 PDT Organization: RoadRunner - West Xref: archiver1.google.com comp.lang.ada:25900 Date: 2002-06-13T18:37:11+00:00 List-Id: Hyman Rosen wrote: > > Darren New wrote: > > Because it prevents the programmer from ignoring the problem. Note, I didn't > > say it prevents the *program* from ignoring it, but the *programmer*. > > > > That is, with checked exceptions, you can't call malloc() without checking > > the result, even if every single time you test the program, you manage to > > allocate enough memory. > > Are we talking about the same thing here? The whole point > of exceptions is exactly to call malloc without checking > the result. I guess it depends on your philosophy. If the creators of Java were looking at C and saying "what are common errors that people make" I can see this being the idea. > With exception-based error handling, code is > written as if errors never happen, and resource allocation > is done with objects which release the resource when their > lifetime ends. Well, yes, in languages where objects have a definite lifetime, this is true. Java isn't like that. Java, instead, has garbage collection. Look at Eiffel for yet another take on exception-based error handling. I'm not saying Java's take on this is right, and I'm not saying it's the best way to handle it. I'm just saying that's how it is. I am explicitly *not* trying to convince you it's good. I don't even think it's good myself. > Then if an error does happen, the exception > propogates out to a handler which usually deals with the > situation in a high-level fashion, and allocated resources > between the point of the exception and the handler are > cleaned up. Yes, and by declaring what exceptions get thrown, you're telling people who are calling your library "hey, here's the exceptions you have to handle in a high-level fashion." Works great, until someone else writes part of the code, and then they call one of your routines. -- Darren New San Diego, CA, USA (PST). Cryptokeys on demand. ** http://home.san.rr.com/dnew/DNResume.html ** ** http://images.fbrtech.com/dnew/ ** My brain needs a "back" button so I can remember where I left my coffee mug.