Mainstream D Programming

Bill Baxter dnewsgroup at billbaxter.com
Sun Oct 14 19:11:09 PDT 2007


Jussi Jumppanen wrote:
> Ary Manzana Wrote:
> 
>> Does nobody refactor their code? 
> 
> I do have to admit the refactoring rename feature found in the MS 
> Visual Studio IDE is very nice, but I'm not going to change my text 
> editor just for one feature.
> 
>> If so, how a text editor helps?
> 
> Refactoring is still possible in a text editor:
> 
>  Syep 1) Run a grep to find all the instances of text
>  Syep 2) Load up all the files found 
>  Syep 3) Change each name one at a time or all in one hit
>  Syep 4) Run a build to check your changes
> 
> This might take an extra minute or two, but it's still pretty 
> easy todo.

Where grep doesn't work so well is when you want to rename a variable 
called 's' to something else.  Or a better example is changing the name 
of a member of one class only.  Say we want to change the "name" member 
of one class.   That's likely to have a lot of false hits that grep, 
without any semantic knowledge, won't be able to help you with.  A good 
refactoring IDE can (I think!) distinguish between things called 'name' 
that are referring to the member of the class in question and those that 
aren't.

--bb



More information about the Digitalmars-d mailing list