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

Re: [XP] Refactoring and XP

Expand Messages
  • james@renaissancesoftware.net
    My top three are rename, extract and move. I use eclipse/cdt. Unfortunately, for C and C++ the only one that is reliable rename. But that by itself is worth
    Message 1 of 18 , Jan 15, 2012
    • 0 Attachment
      My top three are rename, extract and move. I use eclipse/cdt. Unfortunately, for C and C++ the only one that is reliable rename. But that by itself is worth using eclipse/cdt for.

      I searched for RefactorNG and could not find it. Can you post a link?

      James

      --------------------------------------------------------------------------------------------
      James Grenning Author of TDD for Embedded C
      www.renaissancesoftware.net http://pragprog.com/titles/jgade/
      www.renaissancesoftware.net/blog
      www.twitter.com/jwgrenning

      On Jan 15, 2012, at 6:33 AM, Adam Sroka wrote:

      > On Sun, Jan 15, 2012 at 6:09 PM, sandri8428 <scholes84@...> wrote:
      > >
      > >
      > >
      > > Hello everyone,
      > >
      > > Im starting research in XP, right now Ive been reading about Refactoring and I have a question:
      > > Which refactoring technique would you consider the most useful?
      >
      > Rename, move, and extract. I can't choose between the three, but if
      > you pulled my arm I'd pick extract because the other two are easily
      > replaced by find-and-replace and cut-and-paste (*NOT* copy)
      > respectively.
      >
      > > According to your experience Do you believe that the current refactoring tools included in some IDE like RefactoringNG covers most of the refactoring opportunities within a given code?
      > >
      >
      > I'm not familiar with RefactorNG. I've used all of the JetBrains tools
      > and Eclipse. They don't suck, but, IMO, they aren't leaps and bounds
      > above a programmer's editor like emacs, vim, or TextMate. The later
      > three do just fine, IMO.
      >



      [Non-text portions of this message have been removed]
    • Steve
      I program in c# I use rename, extract. I have used others like move up and extract class however visual studio doesn t provide native support for these so I am
      Message 2 of 18 , Jan 15, 2012
      • 0 Attachment
        I program in c# I use rename, extract. I have used others like move up and extract class however visual studio doesn't provide native support for these so I am limited until my company purchases a plugin like resharper

        Sent from my iPhone

        On Jan 15, 2012, at 4:09 AM, "sandri8428" <scholes84@...> wrote:

        > Hello everyone,
        >
        > Im starting research in XP, right now Ive been reading about Refactoring and I have a question:
        > Which refactoring technique would you consider the most useful?
        > According to your experience Do you believe that the current refactoring tools included in some IDE like RefactoringNG covers most of the refactoring opportunities within a given code?
        >
        >


        [Non-text portions of this message have been removed]
      • Adam Sroka
        P.S. I should clarify: I am a huge fan of JetBrains and their tools. If you are working in Java or C#, you have a sufficiently beefy machine, and your company
        Message 3 of 18 , Jan 15, 2012
        • 0 Attachment
          P.S. I should clarify: I am a huge fan of JetBrains and their tools.
          If you are working in Java or C#, you have a sufficiently beefy
          machine, and your company is helping you pay, then I think they are a
          no-brainer. If you are not very experienced with refactoring they also
          hold your hand a bit, which is very nice. Ditto for Eclipse.

          However, the tools still have a long way to go to be as light and
          speedy as something like CLI + a good editor, and if you are working
          in other languages the overhead of the tools can be frustrating. When
          working in e.g. Ruby or JavaScript I find that CLI + editor is much
          less cumbersome and far more portable. So, I still tend to prefer
          that.

          On Sun, Jan 15, 2012 at 9:33 PM, Adam Sroka <adam.sroka@...> wrote:
          > On Sun, Jan 15, 2012 at 6:09 PM, sandri8428 <scholes84@...> wrote:
          >>
          >>
          >>
          >> Hello everyone,
          >>
          >> Im starting research in XP, right now Ive been reading about Refactoring and I have a question:
          >> Which refactoring technique would you consider the most useful?
          >
          > Rename, move, and extract. I can't choose between the three, but if
          > you pulled my arm I'd pick extract because the other two are easily
          > replaced by find-and-replace and cut-and-paste (*NOT* copy)
          > respectively.
          >
          >> According to your experience Do you believe that the current refactoring tools included in some IDE like RefactoringNG covers most of the refactoring opportunities within a given code?
          >>
          >
          > I'm not familiar with RefactorNG. I've used all of the JetBrains tools
          > and Eclipse. They don't suck, but, IMO, they aren't leaps and bounds
          > above a programmer's editor like emacs, vim, or TextMate. The later
          > three do just fine, IMO.
        • George Dinwiddie
          ... I use Extract and Inline a lot, together. It was shocking when I was at a client site and the IDE they used did not support Inline in Java. Rename is also
          Message 4 of 18 , Jan 15, 2012
          • 0 Attachment
            On 1/15/12 4:09 AM, sandri8428 wrote:
            > Hello everyone,
            >
            > Im starting research in XP, right now Ive been reading about
            > Refactoring and I have a question: Which refactoring technique would
            > you consider the most useful?

            I use Extract and Inline a lot, together. It was shocking when I was at
            a client site and the IDE they used did not support Inline in Java.

            Rename is also very handy, and better in many cases than Search and
            Replace. This allows me to not worry about getting the name right the
            first time.

            > According to your experience Do you believe that the current
            > refactoring tools included in some IDE like RefactoringNG covers most
            > of the refactoring opportunities within a given code?

            Depends on the IDE.

            - George

            --
            ----------------------------------------------------------------------
            * George Dinwiddie * http://blog.gdinwiddie.com
            Software Development http://www.idiacomputing.com
            Consultant and Coach http://www.agilemaryland.org
            ----------------------------------------------------------------------
          • RonJeffries
            Hi George, ... Yes. I use rename all the time, so often that I didn t think of it. :) Ron Jeffries www.XProgramming.com I m not bad, I m just drawn that way.
            Message 5 of 18 , Jan 15, 2012
            • 0 Attachment
              Hi George,

              On Jan 15, 2012, at 8:47 PM, George Dinwiddie wrote:

              > Rename is also very handy, and better in many cases than Search and
              > Replace. This allows me to not worry about getting the name right the
              > first time.


              Yes. I use rename all the time, so often that I didn't think of it. :)

              Ron Jeffries
              www.XProgramming.com
              I'm not bad, I'm just drawn that way. -- Jessica Rabbit



              [Non-text portions of this message have been removed]
            • Vladimir Ignatov
              I think rename is essential and should be as much simple as possible. Unfortunately with dynamic languages (say my favorite Python) or in mixed
              Message 6 of 18 , Jan 16, 2012
              • 0 Attachment
                I think "rename" is essential and should be as much simple as possible.

                Unfortunately with "dynamic" languages (say my favorite Python) or in
                "mixed" environment (say - a lot of html, template or javascript code,
                documentation files etc) it is hard to impossible to do "right" renaming
                _automatically_. To help myself I develop a small "cheat". It's so dirty
                and dumb that I am shy to tell you...

                Well, I just force all interesting things to have_unique_ names. Then I use
                simple custom tool to do "mass-renaming". It runs across all source files
                and mindlessly replaces "old names" with "new names" without any manual
                intervention, "previews" or such. Few seconds and your "renaming
                refactoring" is done.

                Yes, it sounds horrible. But it works for me for past several years.

                Vladimir Ignatov


                On Mon, Jan 16, 2012 at 5:50 AM, RonJeffries <ronjeffries@...> wrote:

                > **
                > > Rename is also very handy, and better in many cases than Search and
                > > Replace. This allows me to not worry about getting the name right the
                > > first time.
                >


                [Non-text portions of this message have been removed]
              • Adam Sroka
                I can t tell if you are being sarcastic, but I don t think using unique names is a bad idea at all. Just so long as those names are communicative and not full
                Message 7 of 18 , Jan 16, 2012
                • 0 Attachment
                  I can't tell if you are being sarcastic, but I don't think using
                  unique names is a bad idea at all. Just so long as those names are
                  communicative and not full of a bunch of silly extra characters that
                  are there just to make them unique.

                  I think rename is a great thing to have in an editor, but what it is
                  doing is not any different than what you can do with other tools (e.g.
                  grep/sed/AWK and their ilk, Quicksilver, an editor that has multi-file
                  regex based search and replace, etc.) And move is really nothing more
                  than cut and paste, although having a tool that can move more than one
                  thing at a time just by ticking a box is nice.

                  To me, extract/inline has the most complex semantics of the small,
                  atomic refactorings, because you must add or remove the method
                  signature (More of a pain in languages with curly braces or semantic
                  whitespace.) That is why I agreed with Ron that it is the one I find
                  most useful.

                  Pretty much all more complex refactorings can be composed by combining
                  these techniques. Although, having more advanced refactoring support
                  can be a joy when you know exactly where you want to go and can get
                  there quicker with a big step.

                  So, is advanced refactoring support useful to me? Potentially. Do I
                  want to pay a lot in terms of money, effort learning a new tool,
                  and/or performance overhead to get it? Not really.

                  That's my take.

                  On Mon, Jan 16, 2012 at 6:23 PM, Vladimir Ignatov <kmisoft@...> wrote:
                  >
                  >
                  >
                  > I think "rename" is essential and should be as much simple as possible.
                  >
                  > Unfortunately with "dynamic" languages (say my favorite Python) or in
                  > "mixed" environment (say - a lot of html, template or javascript code,
                  > documentation files etc) it is hard to impossible to do "right" renaming
                  > _automatically_. To help myself I develop a small "cheat". It's so dirty
                  > and dumb that I am shy to tell you...
                  >
                  > Well, I just force all interesting things to have_unique_ names. Then I use
                  > simple custom tool to do "mass-renaming". It runs across all source files
                  > and mindlessly replaces "old names" with "new names" without any manual
                  > intervention, "previews" or such. Few seconds and your "renaming
                  > refactoring" is done.
                  >
                  > Yes, it sounds horrible. But it works for me for past several years.
                  >
                  > Vladimir Ignatov
                  >
                  > On Mon, Jan 16, 2012 at 5:50 AM, RonJeffries <ronjeffries@...> wrote:
                  >
                  > > **
                  >
                  >
                  > > > Rename is also very handy, and better in many cases than Search and
                  > > > Replace. This allows me to not worry about getting the name right the
                  > > > first time.
                  > >
                  >
                  > [Non-text portions of this message have been removed]
                  >
                  >
                • Giorgio Sironi
                  ... I work with dynamic languages, where automated refactoring tools do not exist. I do exactly this but only when I m not sure about a name - for example, on
                  Message 8 of 18 , Jan 16, 2012
                  • 0 Attachment
                    On Mon, Jan 16, 2012 at 10:23 AM, Vladimir Ignatov <kmisoft@...>wrote:

                    > **
                    >
                    > Well, I just force all interesting things to have_unique_ names. Then I use
                    > simple custom tool to do "mass-renaming". It runs across all source files
                    > and mindlessly replaces "old names" with "new names" without any manual
                    > intervention, "previews" or such. Few seconds and your "renaming
                    > refactoring" is done.
                    >

                    I work with dynamic languages, where automated refactoring tools do not
                    exist. I do exactly this but only when I'm not sure about a name - for
                    example, on creation I may call a Command implementation a
                    BaseElementRelatedCommand; in the subsequent commits, it's easy to rename
                    it with sed when I come up with a more meaningful name.

                    --
                    Giorgio Sironi (@giorgiosironi)
                    http://giorgiosironi.blogspot.com


                    [Non-text portions of this message have been removed]
                  • Vladimir Ignatov
                    ... I don t think either. In 99% cases names already born unique without any extra efforts. In the rest 1%, I just make them even more descriptive until they
                    Message 9 of 18 , Jan 16, 2012
                    • 0 Attachment
                      > I don't think using
                      > unique names is a bad idea at all. Just so long as those names are
                      > communicative and not full of a bunch of silly extra characters that
                      > are there just to make them unique.

                      I don't think either. In 99% cases names already born unique without
                      any extra efforts. In the rest 1%, I just make them "even more"
                      descriptive until they become true unique.

                      > I think rename is a great thing to have in an editor, but what it is
                      > doing is not any different than what you can do with other tools (e.g.
                      > grep/sed/AWK and their ilk, Quicksilver, an editor that has multi-file
                      > regex based search and replace, etc.) And move is really nothing more
                      > than cut and paste, although having a tool that can move more than one
                      > thing at a time just by ticking a box is nice.

                      Yes, but... If you need some extra efforts to do renaming, then your
                      (okay - MY) mind would whisper ---- "lets delay this renaming, it can
                      wait...".
                      I do so much renaming only because it so "cheap" and mindless for me.
                      As a bonus my script generates xref files - one for each name with
                      source quotes - how each particular name is used in code.
                      It also able to build a "call chains" and other additional information
                      about my source code - all due the fact that names are garantied to be
                      unique.

                      Vladimir Ignatov
                    • Steve Ropa
                      Hi Steve, I am a little worried about that statement. Please don’t let your tool limit which refactoring methods you use, and don’t wait for a tool before
                      Message 10 of 18 , Jan 16, 2012
                      • 0 Attachment
                        Hi Steve,



                        I am a little worried about that statement. Please don’t let your tool limit which refactoring methods you use, and don’t wait for a tool before you use them. I might be kind of a fuddy-duddy, but I really like to do many of the refactorings “by hand”. It isn’t that I dislike using the tools, and I will definitely use them for simple stuff or just to save typing, but there is something to be said for doing all of the activities yourself.



                        Yet Another Steve



                        From: extremeprogramming@yahoogroups.com [mailto:extremeprogramming@yahoogroups.com] On Behalf Of Steve
                        Sent: Sunday, January 15, 2012 9:02 AM
                        To: extremeprogramming@yahoogroups.com
                        Subject: Re: [XP] Refactoring and XP





                        I program in c# I use rename, extract. I have used others like move up and extract class however visual studio doesn't provide native support for these so I am limited until my company purchases a plugin like resharper

                        Sent from my iPhone

                        On Jan 15, 2012, at 4:09 AM, "sandri8428" <scholes84@... <mailto:scholes84%40gmail.com> > wrote:

                        > Hello everyone,
                        >
                        > Im starting research in XP, right now Ive been reading about Refactoring and I have a question:
                        > Which refactoring technique would you consider the most useful?
                        > According to your experience Do you believe that the current refactoring tools included in some IDE like RefactoringNG covers most of the refactoring opportunities within a given code?
                        >
                        >

                        [Non-text portions of this message have been removed]





                        [Non-text portions of this message have been removed]
                      • Steve
                        Don t get me wrong I have to do move method by hand right now. I didn t mean to imply that I stop trying to remove duplication as soon as it isn t handed to
                        Message 11 of 18 , Jan 16, 2012
                        • 0 Attachment
                          Don't get me wrong I have to do move method by hand right now. I didn't mean to imply that I stop trying to remove duplication as soon as it isn't handed to me.

                          Sent from my iPhone

                          On Jan 16, 2012, at 11:12 AM, "Steve Ropa" <theropas@...> wrote:

                          > Hi Steve,
                          >
                          > I am a little worried about that statement. Please don’t let your tool limit which refactoring methods you use, and don’t wait for a tool before you use them. I might be kind of a fuddy-duddy, but I really like to do many of the refactorings “by hand”. It isn’t that I dislike using the tools, and I will definitely use them for simple stuff or just to save typing, but there is something to be said for doing all of the activities yourself.
                          >
                          > Yet Another Steve
                          >
                          > From: extremeprogramming@yahoogroups.com [mailto:extremeprogramming@yahoogroups.com] On Behalf Of Steve
                          > Sent: Sunday, January 15, 2012 9:02 AM
                          > To: extremeprogramming@yahoogroups.com
                          > Subject: Re: [XP] Refactoring and XP
                          >
                          > I program in c# I use rename, extract. I have used others like move up and extract class however visual studio doesn't provide native support for these so I am limited until my company purchases a plugin like resharper
                          >
                          > Sent from my iPhone
                          >
                          > On Jan 15, 2012, at 4:09 AM, "sandri8428" <scholes84@... <mailto:scholes84%40gmail.com> > wrote:
                          >
                          > > Hello everyone,
                          > >
                          > > Im starting research in XP, right now Ive been reading about Refactoring and I have a question:
                          > > Which refactoring technique would you consider the most useful?
                          > > According to your experience Do you believe that the current refactoring tools included in some IDE like RefactoringNG covers most of the refactoring opportunities within a given code?
                          > >
                          > >
                          >
                          > [Non-text portions of this message have been removed]
                          >
                          > [Non-text portions of this message have been removed]
                          >
                          >


                          [Non-text portions of this message have been removed]
                        • Steve Ropa
                          Whew! I’ve seen folks who believe that strongly. I’m glad I misinterpreted your message. From: extremeprogramming@yahoogroups.com
                          Message 12 of 18 , Jan 16, 2012
                          • 0 Attachment
                            Whew! I’ve seen folks who believe that strongly. I’m glad I misinterpreted your message.



                            From: extremeprogramming@yahoogroups.com [mailto:extremeprogramming@yahoogroups.com] On Behalf Of Steve
                            Sent: Monday, January 16, 2012 10:57 AM
                            To: extremeprogramming@yahoogroups.com
                            Subject: Re: [XP] Refactoring and XP





                            Don't get me wrong I have to do move method by hand right now. I didn't mean to imply that I stop trying to remove duplication as soon as it isn't handed to me.

                            Sent from my iPhone

                            On Jan 16, 2012, at 11:12 AM, "Steve Ropa" <theropas@... <mailto:theropas%40q.com> > wrote:

                            > Hi Steve,
                            >
                            > I am a little worried about that statement. Please don’t let your tool limit which refactoring methods you use, and don’t wait for a tool before you use them. I might be kind of a fuddy-duddy, but I really like to do many of the refactorings “by hand”. It isn’t that I dislike using the tools, and I will definitely use them for simple stuff or just to save typing, but there is something to be said for doing all of the activities yourself.
                            >
                            > Yet Another Steve
                            >
                            > From: extremeprogramming@yahoogroups.com <mailto:extremeprogramming%40yahoogroups.com> [mailto:extremeprogramming@yahoogroups.com <mailto:extremeprogramming%40yahoogroups.com> ] On Behalf Of Steve
                            > Sent: Sunday, January 15, 2012 9:02 AM
                            > To: extremeprogramming@yahoogroups.com <mailto:extremeprogramming%40yahoogroups.com>
                            > Subject: Re: [XP] Refactoring and XP
                            >
                            > I program in c# I use rename, extract. I have used others like move up and extract class however visual studio doesn't provide native support for these so I am limited until my company purchases a plugin like resharper
                            >
                            > Sent from my iPhone
                            >
                            > On Jan 15, 2012, at 4:09 AM, "sandri8428" <scholes84@... <mailto:scholes84%40gmail.com> <mailto:scholes84%40gmail.com> > wrote:
                            >
                            > > Hello everyone,
                            > >
                            > > Im starting research in XP, right now Ive been reading about Refactoring and I have a question:
                            > > Which refactoring technique would you consider the most useful?
                            > > According to your experience Do you believe that the current refactoring tools included in some IDE like RefactoringNG covers most of the refactoring opportunities within a given code?
                            > >
                            > >
                            >
                            > [Non-text portions of this message have been removed]
                            >
                            > [Non-text portions of this message have been removed]
                            >
                            >

                            [Non-text portions of this message have been removed]





                            [Non-text portions of this message have been removed]
                          • Tom
                            Visual Studio without ReSharper is unbearable. I bought a license with my own money when a client wouldn t pop for it. I use Java and Ruby at home for
                            Message 13 of 18 , Jan 16, 2012
                            • 0 Attachment
                              Visual Studio without ReSharper is unbearable. I bought a license with my own money when a client wouldn't pop for it. I use Java and Ruby at home for financial and other reasons, so I had no use for that license except to keep my workdays from being a living hell.

                              --- In extremeprogramming@yahoogroups.com, Steve <solomon.steven.m@...> wrote:
                              >
                              > I program in c# I use rename, extract. I have used others like move up and extract class however visual studio doesn't provide native support for these so I am limited until my company purchases a plugin like resharper
                              >
                              > Sent from my iPhone
                              >
                              > On Jan 15, 2012, at 4:09 AM, "sandri8428" <scholes84@...> wrote:
                              >
                              > > Hello everyone,
                              > >
                              > > Im starting research in XP, right now Ive been reading about Refactoring and I have a question:
                              > > Which refactoring technique would you consider the most useful?
                              > > According to your experience Do you believe that the current refactoring tools included in some IDE like RefactoringNG covers most of the refactoring opportunities within a given code?
                              > >
                              > >
                              >
                              >
                              > [Non-text portions of this message have been removed]
                              >
                            • Tom Rossen
                              If you create a property in C# whose type is a class, the naming convention (supported by ReSharper) is to use exactly the same orthography as the class name
                              Message 14 of 18 , Jan 16, 2012
                              • 0 Attachment
                                If you create a property in C# whose type is a class, the naming convention (supported by ReSharper) is to use exactly the same orthography as the class name itself.  Without code analysis, any of the tools you mention would wreak havoc if you used them to change the name of such a property.  ReSharper and Eclipse's refactoring are definitely safer.


                                ________________________________
                                From: Adam Sroka <adam.sroka@...>


                                ...
                                I think rename is a great thing to have in an editor, but what it is
                                doing is not any different than what you can do with other tools (e.g.
                                grep/sed/AWK and their ilk, Quicksilver, an editor that has multi-file
                                regex based search and replace, etc.) And move is really nothing more
                                than cut and paste, although having a tool that can move more than one
                                thing at a time just by ticking a box is nice.

                                ....

                                [Non-text portions of this message have been removed]
                              • Adam Sroka
                                +1 It is important to recognize that these opinions depend on the language and environment. My earlier comments are mostly from the point of view of a web
                                Message 15 of 18 , Jan 16, 2012
                                • 0 Attachment
                                  +1

                                  It is important to recognize that these opinions depend on the language and
                                  environment. My earlier comments are mostly from the point of view of a web
                                  programmer with years of Ruby/Python/Perl/JavaScript experience (using TDD
                                  and Refactoring.) I have also worked as a Java and C# programmer, and find
                                  IntelliJ and ReSharper (respectively) invaluable when forced to work in
                                  those languages.

                                  On Tue, Jan 17, 2012 at 11:52 AM, Tom <rossentj@...> wrote:

                                  > **
                                  >
                                  >
                                  > Visual Studio without ReSharper is unbearable. I bought a license with my
                                  > own money when a client wouldn't pop for it. I use Java and Ruby at home
                                  > for financial and other reasons, so I had no use for that license except to
                                  > keep my workdays from being a living hell.
                                  >
                                  >
                                  > --- In extremeprogramming@yahoogroups.com, Steve <solomon.steven.m@...>
                                  > wrote:
                                  > >
                                  > > I program in c# I use rename, extract. I have used others like move up
                                  > and extract class however visual studio doesn't provide native support for
                                  > these so I am limited until my company purchases a plugin like resharper
                                  > >
                                  > > Sent from my iPhone
                                  > >
                                  > > On Jan 15, 2012, at 4:09 AM, "sandri8428" <scholes84@...> wrote:
                                  > >
                                  > > > Hello everyone,
                                  > > >
                                  > > > Im starting research in XP, right now Ive been reading about
                                  > Refactoring and I have a question:
                                  > > > Which refactoring technique would you consider the most useful?
                                  > > > According to your experience Do you believe that the current
                                  > refactoring tools included in some IDE like RefactoringNG covers most of
                                  > the refactoring opportunities within a given code?
                                  > > >
                                  > > >
                                  > >
                                  > >
                                  > > [Non-text portions of this message have been removed]
                                  > >
                                  >
                                  >
                                  >


                                  [Non-text portions of this message have been removed]
                                Your message has been successfully submitted and would be delivered to recipients shortly.