Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Eric Sosman Newsgroups: comp.lang.java.programmer Subject: Re: About java program. Date: Sun, 07 Jul 2013 20:42:21 -0400 Organization: A noiseless patient Spider Lines: 40 Message-ID: References: <324f929f-772e-4004-81e1-6b454cdae794@googlegroups.com> <19wnriq53qxel.u9rt8wy6z52g.dlg@40tude.net> <1lvu4yv8sxe73$.n4o05ixuag9y.dlg@40tude.net> <85GdncWZdo04-lzMnZ2dnUVZ8mydnZ2d@bt.com> <51d6396c$0$295$14726298@news.sunsite.dk> <51d9fb26$0$301$14726298@news.sunsite.dk> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit Injection-Date: Mon, 8 Jul 2013 00:36:45 +0000 (UTC) Injection-Info: mx05.eternal-september.org; posting-host="0d73d8cc209bff1c6395088b400d0605"; logging-data="30304"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/QDNelfaf07cKfjAD18183" User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:17.0) Gecko/20130620 Thunderbird/17.0.7 In-Reply-To: <51d9fb26$0$301$14726298@news.sunsite.dk> Cancel-Lock: sha1:x6zA40f/M/m9kghrsL45ldljdaw= Xref: csiph.com comp.lang.java.programmer:24704 On 7/7/2013 7:35 PM, Arne Vajhøj wrote: > On 7/7/2013 6:07 PM, Eric Sosman wrote: >> On 7/7/2013 2:43 PM, Robert Klemme wrote: >>> On 06.07.2013 14:22, Eric Sosman wrote: >>>> On 7/6/2013 7:14 AM, Robert Klemme wrote: >>>>> [...] >>>>> Well, you can forget the logging on *any* level of the application. >>>>> There is no really a difference between asking the author of this >>>>> method >>>>> to do proper error handling or asking the author of some other code to >>>>> do it. >>>> >>>> The caller has more context. When Integer.parseInt() is >>>> unable to make sense of the input string, it has no way of knowing >>>> whether the failure is fatal, unusual, or expected. Do you think >>>> it should log all such failures in addition to throwing up? >>> >>> No. That is exactly my point. >> >> Okay, you've confused me. I maintain that the caller has more >> context than the callee, and is therefore (often) in a better position >> to make wider-scope decisions in handling errors. That, it seems to >> me, is a distinct and notable difference in how the errors are handled. >> Yet you say "there is really no difference" in handling an error Here >> or There (or maybe even Elsewhere). I don't get it. > > Before you continue the discussion then maybe you should clarify the > topic of discussion: "should called often delegate exception handling to > caller" vs "should called often delegate exception logging to caller". All right: What are *your* thoughts on Integer.parseInt() logging every unsuccessful conversion? (And why limit logging to *un*successful conversions? An unexpected successful conversion can be just as important, can it not?) -- Eric Sosman esosman@comcast-dot-net.invalid