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

Newbies With XP & Patterns (was RE: [XP] Re: Reversibility and sy mmetry)

Expand Messages
  • Berkowitz, Steven
    ... There s something that s been nagging at me for a while, but I ve been having trouble putting it into words. You say without regards to pattern or overall
    Message 1 of 10 , Oct 31, 2000
    • 0 Attachment
      Newbies With XP & Patterns (was RE: [XP] Re: Reversibility and symmetry)

      > >So are you talking about the whole of XP? Some specific practices? An
      > >approach to those practices? What? What should I try doing
      > here? Or should
      > >I just swap DNA with Kent in order to achieve this effect?
      >
      > Test-first programming, in little tiny bites, without regard
      > to patterns or
      > overall structure. Just write tiny test, make test work,
      > refactor, repeat
      > until 250,000 lines of code.
      >
      > That is, as close as one can get to zero design up front. I
      > used to think
      > Kent just thought real fast. In my case we have reason to
      > believe that's
      > not so true.
      >

      There's something that's been nagging at me for a while, but I've been having trouble putting it into words.

      You say "without regards to pattern or overall structure."  But is this really the case?

      Write Test - okay, I can see that how this can be done without regards, etc.
      Make Test Work - ditto.
      Refactor - no way. 

      My (admittedly naive and relatively uninformed) take on XP is that it is in the Refactor Mercilessly stage of development where code is adapted, where design is modified to better meet the needs of the current situation.  It is here where patterns are potentially recognized as useful and put in to place if they are.

      A while back, one of the XPerts (I think it was Ron, but I can't swear to it) said there is nothing more dangerous than a little boy who just discovered GoF.  This week, in another thread, Kent said (I'm paraphrasing) the XP Pattern user has the restraing to lay off the patterns until/unless they are really needed.

      If I don't know patterns, or other good OO techniques, I can't use them.  My toolbox lacks some essential implements that enable me to refactor mercilessly.  I suggest to you that Kent, and other veterans, use their knowledge of patterns in this stage.  They may use that knowledge so as not to implement a pattern, but they use it nonetheless.  And use it in a way that we newbies cannot.

      What I am trying to say is that an understanding of patterns makes a better OO programmer.  I have recently acquired GoF and it is my next non-fiction read.  Is there anyone on this list who would suggest that I shouldn't?  If this will, for a while, make me a dangerous OO programmer (which, I admit, makes sense, after all, who doesn't like to play with new toys) how does my XP coach or my OOP mentor help me overcome this danger?

      Steven Berkowitz
      steven.berkowitz@...
      My apologies for cluttering your life with this disclaimer, but I'm
      toast without it:
      Any opinions expressed herein are mine and do not necessarily represent
      those of AIG

    • Kevin Smith
      Message 2 of 10 , Oct 31, 2000
      • 0 Attachment
      • David Rosenstrauch
        ... Hi Steve. No, I definitely think that you should read GOF. Every OO programmer should, IMHO. It really opens your eyes to the real power of OO, and
        Message 3 of 10 , Oct 31, 2000
        • 0 Attachment
          At 10:54 AM 10/31/00 -0500, you wrote:
          >What I am trying to say is that an understanding of patterns makes a better OO programmer. I have recently acquired GoF and it is my next non-fiction read. Is there anyone on this list who would suggest that I shouldn't? If this will, for a while, make me a dangerous OO programmer (which, I admit, makes sense, after all, who doesn't like to play with new toys) how does my XP coach or my OOP mentor help me overcome this danger?
          >
          >Steven Berkowitz


          Hi Steve. No, I definitely think that you should read GOF. Every OO programmer should, IMHO. It really opens your eyes to the real power of OO, and totally changes your way of thinking. (As an aside, it's actually a pretty easy read, too. It's by its nature as a cookbook broken down into lots of nice, small, easily digestable little chapters.)

          I wouldn't say that it would make you a dangerous OO programmer. But what has happened to some is that it really takes over their consciousness: "everything is a pattern", "patterns are everywhere". Their whole code gets taken over by patterns and their whole way of thinking about code is "how can I fit a pattern in here". Hence the "small boy with a pattern" phenomenon that was mentioned (but not clearly defined) earlier: "I've got a new pattern, and I'm going to use it EVERYWHERE!"

          I think XP addresses patterns quite nicely, however. DTSTTCPW generally means that you don't introduce patterns right in the beginning - they're usually not the simplest thing that could possibly work. Usually I'd say they become and outgrowth of Refactor Mercilessly and OAOO - sometimes in your efforts to do something Once and Only Once you find that one of the GOF patterns would nicely take care of that.

          Josh Kerievsky wrote a good paper on this very topic that I stumbled onto not too long ago (but can't find right now - link anyone?) on this very topic that describes patterns as a goal for your code. Martin Fowler also discusses this a bit in the "Patterns and XP" section of his article "Is Design Dead?" (http://www.martinfowler.com/articles/designDead.html)

          Hope this is helpful to you.


          DR
        • Joshua Kerievsky
          ... It is and it isn t. I wrote a paper for XP2000 called Patterns & XP -- it might shed some light on this for you. See
          Message 4 of 10 , Oct 31, 2000
          • 0 Attachment
            >
            > You say "without regards to pattern or overall structure." But is this
            > really the case?


            It is and it isn't. I wrote a paper for XP2000 called "Patterns & XP" -- it
            might shed some light on this for you. See
            http://industriallogic.com/xp/expositions.html

            regards,
            jk

            _______________________________
            Industrial Logic, Inc.
            Joshua Kerievsky, founder
            mailto:joshua@...
            http://industriallogic.com
            415-292-6266
            415-292-6267 (fax)
          • Ron Jeffries
            ... What is interesting - I claim - is the extent to which good design is the emergent result of the rules of code quality in XP Explained: 1. Runs all the
            Message 5 of 10 , Oct 31, 2000
            • 0 Attachment
              At 10:54 AM 10/31/00 -0500, Berkowitz, Steven wrote:

              You say "without regards to pattern or overall structure."  But is this really the case?


              Write Test - okay, I can see that how this can be done without regards, etc.
              Make Test Work - ditto.
              Refactor - no way. 

              My (admittedly naive and relatively uninformed) take on XP is that it is in the Refactor Mercilessly stage of development where code is adapted, where design is modified to better meet the needs of the current situation.  It is here where patterns are potentially recognized as useful and put in to place if they are.
              What is interesting - I claim - is the extent to which good design is the emergent result of the rules of code quality in XP Explained: 

              1. Runs all the tests.
              2. Expresses all the ideas you want to express.
              3. Contains no duplicate code.
              4. Contains minimum number of classes and methods.

              But read on ... I don't mean to disagree with your point ...

              If I don't know patterns, or other good OO techniques, I can't use them.  My toolbox lacks some essential implements that enable me to refactor mercilessly.  I suggest to you that Kent, and other veterans, use their knowledge of patterns in this stage.  They may use that knowledge so as not to implement a pattern, but they use it nonetheless.  And use it in a way that we newbies cannot.

              I'm sure that patterns, published and otherwise, are flashing through my mind all the time. Unlike Josh - I think I'm being fair to him here - I rarely if ever set out to install a pattern. But certainly I think "Hmm, we're going to want Composite here".

              Knowing the patterns, and everything else we can know, is the difference between a great programmer and an ordinary one, or between an ordinary one and a bad one. Know everything.

              What I am trying to say is that an understanding of patterns makes a better OO programmer.  I have recently acquired GoF and it is my next non-fiction read.  Is there anyone on this list who would suggest that I shouldn't?  If this will, for a while, make me a dangerous OO programmer (which, I admit, makes sense, after all, who doesn't like to play with new toys) how does my XP coach or my OOP mentor help me overcome this danger?

              Absolutely read it. Better yet, implement all the patterns that seem interesting to you - or that you don't understand. But consider not implementing them in your production code, but instead in experiments done off-line in times of low stress.

              Play with the new toys. When you put them in the production code - and you will - just make sure there isn't a line of code in there that isn't needed. Build for today, with everything you know in your mind. Build for simplicity, using the least mechanism you can get away with. And rip out the filigree whenever you notice it.

              Regards,



              Ronald E Jeffries
              http://www.objectmentor.com
            • Phlip
              From: Kevin Smith ... better OO programmer. I have recently acquired GoF and it is my next non-fiction read. Is there anyone on this list who would suggest
              Message 6 of 10 , Oct 31, 2000
              • 0 Attachment
                From: Kevin Smith

                > What I am trying to say is that an understanding of patterns makes a
                better OO programmer. I have recently acquired GoF and it is my next
                non-fiction read. Is there anyone on this list who would suggest that I
                shouldn't? If this will, for a while, make me a dangerous OO programmer
                (which, I admit, makes sense, after all, who doesn't like to play with new
                toys) how does my XP coach or my OOP mentor help me overcome this danger?

                By giving your pair a can of pepper spray...

                Phlip
                ======= http://users.deltanet.com/~tegan/home.html =======
              • Kent Beck
                You say without regards to pattern or overall structure. But is this really the case? Test-first coding is only myopic in spots. When you are
                Message 7 of 10 , Oct 31, 2000
                • 0 Attachment
                  "You say "without regards to pattern or overall structure."  But is this really the case? "
                   
                  Test-first coding is only myopic in spots. When you are implementing a test, if the test is easy to write, you just write it. If it's hard to write, the blinders come off and you look for a way to make the test easy to write, even if that requires you to change a bunch of interfaces. When you are making a test work, if the test is easy to make work, you just make it work. If it's hard to make work, the blinders come off and you look for a way to make the test easy to make work, even if that requires you to change a bunch of interfaces or implementations. In the afterglow of a test (and more so at the end of a task), you definitely take the blinders off and look for wide-spread duplication to remove.
                   
                  Kent
                • kjray
                  Berkowitz, Steven on 10/31/00 7:54 AM wrote: [...] ... One of my new co-workers asked me to recommend good books on Object Oriented
                  Message 8 of 10 , Oct 31, 2000
                  • 0 Attachment
                    Berkowitz, Steven <steven.berkowitz@...> on 10/31/00 7:54 AM wrote:
                    [...]
                    >I have recently acquired GoF and it is my next non-fiction
                    >read. Is there anyone on this list who would suggest that I shouldn't?

                    One of my new co-workers asked me to recommend good books on Object
                    Oriented Design. I couldn't think of any that I could recommend, so I
                    suggested "Design Patterns", "Refactoring", the 3 Java Design Patterns
                    books, the book "C++ FAQs", and all four of the PLoP books. My opinion is
                    that reading good examples of design is better than someone telling you
                    "how" to design.

                    Reading lots of existing code, and see how unmaintainable some of it is,
                    can teach ya how NOT to design, as well. But the "AntiPatterns" book is
                    not on my recommended reading list -- not enough substance.

                    [...]
                  • Phlip
                    From: kjray ... In some shops this book is a gift from heaven. Phlip ======= http://users.deltanet.com/~tegan/home.html =======
                    Message 9 of 10 , Oct 31, 2000
                    • 0 Attachment
                      From: "kjray"


                      > ...But the "AntiPatterns" book is
                      > not on my recommended reading list -- not enough substance.

                      In some shops this book is a gift from heaven.

                      Phlip
                      ======= http://users.deltanet.com/~tegan/home.html =======
                    • Joshua Kerievsky
                      ... I too rarely set out to install a pattern -- I thought I wrote about that last year and just talked about in my OOPSLA tutorial, Refactoring to Patterns.
                      Message 10 of 10 , Nov 1, 2000
                      • 0 Attachment
                        Ron Jeffries wrote:
                        >
                        > I'm sure that patterns, published and otherwise, are flashing through my mind
                        > all the time. Unlike Josh - I think I'm being fair to him here - I rarely if
                        > ever set out to install a pattern. But certainly I think "Hmm, we're going to
                        > want Composite here".


                        I too rarely set out to install a pattern -- I thought I wrote about that last
                        year and just talked about in my OOPSLA tutorial, Refactoring to Patterns.
                        Something lead to you think otherwise?

                        --jk


                        _______________________________
                        Industrial Logic, Inc.
                        Joshua Kerievsky, founder
                        mailto:joshua@...
                        http://industriallogic.com
                        415-292-6266
                        415-292-6267 (fax)
                      Your message has been successfully submitted and would be delivered to recipients shortly.