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

Re: Coding style (Re: [XP] Re: Collective Code Ownership)

Expand Messages
  • Corey Haines
    Sure, Ron! Let me pull some out of our code next week, and I ll post some. -corey ... -- http://www.coreyhaines.com [Non-text portions of this message have
    Message 1 of 60 , Aug 31, 2007
    • 0 Attachment
      Sure, Ron! Let me pull some out of our code next week, and I'll post some.

      -corey


      On 8/30/07, Ron Jeffries <ronjeffries@...> wrote:
      >
      > Hello, Corey. On Thursday, August 30, 2007, at 11:06:50 PM, you
      > wrote:
      >
      > > I'll agree with J.B. about the quaintness of loops. I primarily deal in
      > C#,
      > > and we haven't actually written a loop in about 6-7 months. We have a
      > class
      > > that looks like
      >
      > > CustomEnumerations
      >
      > > .ForEach<T>(IEnumerable<T> list, Action<T> action, params Predicate<T>
      > > whereClauses)
      > > .Select<T>(IEnumerable<T> list, params Predicate<T> whereClauses) :
      > > IEnumerable<T>
      > > .Convert<From,To>(IEnumerable<From> list, Converter<From,To> converter,
      > > params Predicate<T> whereClauses)
      > > .Count...
      > > .Exists...
      > > .SelectFirst...
      > > etc.
      >
      > Looks nice. Show us, please, some examples of use?
      >
      > Ron Jeffries
      > www.XProgramming.com
      > Debugging is twice as hard as writing the code in the first place.
      > Therefore, if you write the code as cleverly as possible, you are,
      > by definition, not smart enough to debug it. -- Brian Kernighan
      >
      >
      >



      --
      http://www.coreyhaines.com


      [Non-text portions of this message have been removed]
    • J. B. Rainsberger
      ... I typically put blank lines between the arrange, act and assert parts of my tests, assuming that the whole test is more than a one-liner, but that s the
      Message 60 of 60 , Sep 10, 2007
      • 0 Attachment
        Ron Jeffries wrote:

        > Hello, Chris. On Monday, September 10, 2007, at 3:52:48 AM, you
        > wrote:
        >
        > > I'm with you, Joe: my rule of thumb is that a method that has blank
        > > lines in it either shouldn't have them or is too long.
        >
        > Yes. If there are blank lines in a method that aren't just a
        > mistake, then they are setting off one bit of code from another.
        > Those bits are being set off because they each do something that is
        > a sort of unified step toward some final result. They each embody an
        > "idea".
        >
        > So I'd figure out what that idea is ... and extract a method with
        > that name.

        I typically put blank lines between the arrange, act and assert parts of
        my tests, assuming that the whole test is more than a one-liner, but
        that's the only common exception I can think of.
        --
        J. B. (Joe) Rainsberger :: http://www.jbrains.ca
        Your guide to software craftsmanship
        JUnit Recipes: Practical Methods for Programmer Testing
        2005 Gordon Pask Award for contribution Agile Software Practice
      Your message has been successfully submitted and would be delivered to recipients shortly.