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 10:48:17 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!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: <3D08DAFC.D6BB2ECC@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> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Date: Thu, 13 Jun 2002 17:48:17 GMT NNTP-Posting-Host: 66.75.151.160 X-Complaints-To: abuse@rr.com X-Trace: twister.socal.rr.com 1023990497 66.75.151.160 (Thu, 13 Jun 2002 10:48:17 PDT) NNTP-Posting-Date: Thu, 13 Jun 2002 10:48:17 PDT Organization: RoadRunner - West Xref: archiver1.google.com comp.lang.ada:25895 Date: 2002-06-13T17:48:17+00:00 List-Id: Hyman Rosen wrote: > But why does every intervening function in the > call tree have to state for the record that it knows that > something it calls may throw such an exception, if it is > not the place where the exception is handled? 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. In other words, it's much the same way that Java refuses to compile somthing like int x; if (y) {x = 5;} blah(x); /* because x *might* be uninitialized, even if the programmer knows that Y will always be true at this point. */ The problem with checked exceptions is that when you're using a lot of libraries with callbacks and such, the checked exceptions require you to handle the exception in the *wrong* place. It's difficult to get around in any clean way, unlike the uninitialized-variable problem. -- 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.