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

Re: [XP] Writing simple software - A Challenge!

Expand Messages
  • Ron Jeffries
    ... I don t think anyone would be suggesting silently fail, f2king everyone over . In the save example, I think that an exception might be appropriate,
    Message 1 of 139 , Dec 1, 2002
    • 0 Attachment
      On Sunday, December 1, 2002, at 4:38:48 PM, Kyle Cordes wrote:

      >> The suggestion isn't to mask exceptions. It's to define methods that
      >> DO NOT HAVE exceptions.


      > To refer back to an earlier example, what's a good way to handle:

      > obj.saveStateToDisk()

      > ? When I call such a method, I'd rather like to know whether it was
      > able to get the data on to the disk. Normally I'd deal with this by
      > making sure it either got the data written, or threw an exception. I'm
      > open to hearing about other approaches. I don't think "silently fail,
      > so the user and the rest of the app thinks its worked, but it really
      > didn't" is a good approach.

      I don't think anyone would be suggesting "silently fail, f2king
      everyone over".

      In the save example, I think that an exception might be appropriate,
      because the situation is in fact exceptional. HOWEVER, that means that
      nowhere in the universe is it safe to call that method without dealing
      with the exception. That will lead to duplication, which by our rules
      must be removed. That, oddly enough, will quite often lead to a method
      which cannot hurl.

      Another possibility that might sometimes be better would be for the
      saveStateToDisk() method to loop, popping up a dialog demanding that
      the user make space and try again, point to another storage medium, or
      acknowledge that he doesn't want to save after all.

      In fact, that might well be what we'd wind up with when we removed the
      duplication mentioned above ...

      Ron Jeffries
      www.XProgramming.com
      It is not because things are difficult that we do not dare,
      it is because we do not dare that they are difficult. --Seneca
    • 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.