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

Re: [XP] Eliminate Exceptions (was: Writing simple software - A Challenge!)

Expand Messages
  • Bill de hÓra
    ... Me too. I think the problem with exceptions are that we tie them to package types and things (into the problem domain) rather than failure cases (into the
    Message 1 of 139 , Dec 2, 2002
    • 0 Attachment
      Kyle Cordes wrote:
      > From: "Kevin Smith" <kevinxp@...>
      >
      >>>Well, would you explain more about not throwing them?
      >>
      >>If exceptions are thrown, then they must be caught. That requires
      >
      > code.
      >
      >>So, given a chance, write methods that don't throw exceptions. If you
      >>can catch an exception and "do something reasonable", that's often
      >>better than propagating the exception up the chain.
      >
      >
      >
      > I'd experience significant misery from codes that takes this too far.
      > For example, code that read a list of widgets from the database
      > according to parameters X. The way I code it, if X is invalid, throw an
      > exception. If the database doesnt work, throw an exception.

      Me too.

      I think the problem with exceptions are that we tie them to package
      types and things (into the problem domain) rather than failure cases
      (into the runtime behaviour). Thus we have far too many different
      exceptions in everyday code, many of which describe (and dome would
      say mask) the same failure case. Since thre are usually more verbs
      than nouns in any language, this imbalance shouldn't surprise
      anyone. Java is the prime exemplar of how not to use exceptions.

      Bill de hÓra
    • J. B. Rainsberger
      So said ericheikkila on 12/4/2002 -------------------- ... Often, i means something. Say what you mean; mean what you say. :) J. B. Rainsberger,
      Message 139 of 139 , Dec 7, 2002
      • 0 Attachment
        So said ericheikkila on 12/4/2002 --------------------

        >Single letter variables drive me nuts. ;)
        >I use 'index' instead of 'i' (or loop, or maybe count, depending on
        >the context).
        >As far as abbreviations go...if the entire team agrees, fine.
        >If someone on the team doesn't know that itr is the same as iterator,
        >just change it to iterator.
        >
        >Usually, I'll not abbrev ;)

        Often, "i" means something. Say what you mean; mean what you say. :)

        J. B. Rainsberger,
        President, Diaspar Software Services
        Let's write software that people understand.
        http://www.diasparsoftware.com/
        telephone: +1 416 791-8603
        All correspondence (c) 2002 Diaspar Software Services.
        If you want to use it, just ask; don't steal.
      Your message has been successfully submitted and would be delivered to recipients shortly.