Sunday, January 01, 2006

What Good Is That?

VS2005 has code refactoring. There are several refactorings you can do, from a simple rename to extracting a method. I love extracting a method. I hate rename. Let me explain.

When I'm first writing a method, I tend to name local variables with short, cryptic names because they're easier to type. After I get the bulk of the method written, I want to change the names to something more meaningful. In VS2003 I would select the body of the method and do a change all in selection. Worked just fine.

In VS2005, I thought the Refactor, Rename would be a better way to go. So I would select that p or whatever and rename it. The problem is that Refactor, Rename is even stupider than a text replacement command. It wants to change every p in the entire solution. Why would it do that? Clearly, it knows this p is a local variable and is in no way related to any other p anywhere. But it insists on putting up a tree with every p in the program. Then I have to uncheck all the ones I don't want to change. What good is that? It's easy to make a mistake and change something you don't want to. At least with the Change Text command, it limits itself to the selection.

Stupid, stupid, stupid.

0 Comments:

Post a Comment

<< Home