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

RE: [XP] Re: Collective Code Ownership

Expand Messages
  • Brad Stiles
    ... Well, aside from the last part, and the part about cluttering up the source with *comments* that have nothing to do with the code itself, (which is what
    Message 1 of 60 , Sep 2, 2007
    • 0 Attachment
      > If you can't understand this method from the source and the
      > tests, contact Brad Stiles at xxx xxx-xxxx and collect $20.

      Well, aside from the last part, and the part about cluttering up the
      source with *comments* that have nothing to do with the code itself,
      (which is what I'm trying to avoid), the thing I was trying to avoid,
      that's pretty much what I do. :)

      Brad
    • 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.