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

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

Expand Messages
  • Kyle Cordes
    From: Ron Jeffries ... It s not often I disagree with Ron, but here goes: I find the second behaviour a pain to deal with. If I pass
    Message 1 of 139 , Dec 1, 2002
      From: "Ron Jeffries" <ronjeffries@...>

      > public string ConcatenateTextFiles(string[] textfilenames) returns a
      > string containing all the lines of text from all the files listed,
      > up to a maximum of 32767 characters. If no text is found, the method
      > returns an empty string. Non-text characters are ignored. File names
      > that cannot be opened or read are ignored.
      >
      > The second method is probably easier to write and certainly easier
      > to use.


      It's not often I disagree with Ron, but here goes:

      I find the second behaviour a pain to deal with. If I pass this thing a
      filename, I except it to read that file. If it can't, it shouldn't
      silently ignore my intention and let the problem slip past, it should
      complain - I should get an exception that the file shouldn't be read.
      I've found low-level code eating errors is a very common cause of
      unreliable, unpredictable behavious in largers systems I work on.

      My general guideline is that a method / object should do what I told it
      it do, or fall on its sword trying.

      Kyle Cordes
      www.kylecordes.com
    • 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
        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.