Loading ...
Sorry, an error occurred while loading the content.

Re: [XP] Re: Pattern Encoded Suffix

Expand Messages
  • John Goodsen
    Check out this excellent text on the subject http://pragprog.com/book/ager/exceptional-ruby ... -- John Goodsen RADSoft / Better Software
    Message 1 of 191 , Sep 23, 2012
    • 0 Attachment
      Check out this excellent text on the subject
      http://pragprog.com/book/ager/exceptional-ruby


      On Sat, Sep 22, 2012 at 4:35 AM, JeffGrigg <jeffreytoddgrigg@...>wrote:

      > In Java, you should throw a checked exception when you know that all of
      > the methods that call you should handle it.
      >
      > But if you know that, then you probably shouldn't throw an exception; you
      > should just return the information the callers need.
      >
      > And really, in the real world you'll almost never know where in the call
      > chain an exception should be handled, when you're throwing it. If you do,
      > then you're probably misusing exceptions.
      >
      > (I should know. I can think of several times when I've done that. And
      > yes, I was misusing exceptions at the time. "So sue me." ;-)
      >
      > The code that throws an exception should not (and cannot reasonably) know
      > how the code that catches it will handle it. It's the responsibility of
      > the code that catches the exception to do the right thing.
      >
      > When your programmers are not handling exceptions properly, it's time to
      > change your programmers. Fortunately, there are tools that can help you
      > find these problems.
      >
      >
      > --- "MarvinToll.com" <MarvinToll@...> wrote:
      > > I've written some thoughts on the notion of enhancing code
      > > understandability by clarifying when one is coding Exception
      > > Path (or flow) processing vs. Alternate Path (or flow)
      > > processing.
      > >
      > > http://wp.me/P1FU3L-FE
      > >
      > > _Marvin
      > > PatternEnabled.com
      >
      >
      >
      > ------------------------------------
      >
      > To Post a message, send it to: extremeprogramming@...
      >
      > To Unsubscribe, send a blank message to:
      > extremeprogramming-unsubscribe@...
      >
      > ad-free courtesy of objectmentor.comYahoo! Groups Links
      >
      >
      >
      >


      --
      John Goodsen RADSoft / Better Software Faster
      jgoodsen@... Lean/Kanban/XP/Scrum Coaching and Training
      http://www.radsoft.com Enterprise Ruby, Java and Scala Solutions


      [Non-text portions of this message have been removed]
    • MarvinToll.com
      Jeff, Thanks for your feedback. The notion that a a Java author precisely considers whether they are using one of the two exception mechanisms to indicate a
      Message 191 of 191 , Sep 23, 2012
      • 0 Attachment
        Jeff,

        Thanks for your feedback.

        The notion that a a Java author precisely considers whether they are using one of the two exception mechanisms to indicate a true unanticipated exceptional break-down, or as an indication of alternate path processing (e.g. instead of return codes), is the thought-path I'm suggesting for consideration.

        As you mentioned (twice), there are contexts where the author could be wrong... and the code catching can respond as required.

        Said another way, I'm suggesting that authors throwing exceptions clarify the intended usage... even though a client's corner-case might warrant a different course than the author anticipated.

        _Marvin
        PatternEnabled.com

        --- In extremeprogramming@yahoogroups.com, "JeffGrigg" <jeffreytoddgrigg@...> wrote:
        >
        > The code that throws an exception should not (and cannot reasonably) know how the code that catches it will handle it. It's the responsibility of the code that catches the exception to do the right thing.
        >
      Your message has been successfully submitted and would be delivered to recipients shortly.