Xcode 3 Refactoring

I have this thing about naming everything just right. For example, variables, methods and just about anything else that I code and have control over has to be named just right, in that its descriptive name should allow me to immediately identify its purpose relatively quickly without having to search through headers. Doing this usually means that well after creating a new variable or method I end up wanting to change it based on the fact that I've either come up with a better name or that it now conflicts with some other new creation. Anyway, Xcode 3 has just made my rather obsessive renaming habit a whole lot easier with its new refactoring option.

Xcode 3 Refactoring

Previously I would use Xcode's global find and replace, but because this would also include things like comments I had to be very careful what I was actually replacing. Now I simply highlight the text which I intend to rename and right click, choosing 'Refactor' from the menu, which produces the above window. The nice thing about the new refactoring options is that it gives you the chance to preview your changes using Xcode's built in diff display, as well as the option to take what Xcode refers to as a snapshot before the changes are made. This option is especially useful as it provides you the ability to revert all your changes in the future for whatever reason, but is not really necessary if your code base is under some other form of version control, for example, Subversion.

Xcode's intelligent refactoring is just one of my new favourite features in Xcode 3 alongside the improved syntax highlighting and the 'Focus Follow Selection' option, which by the way is featured on the first Xcode Quick Tips screencast on the newly established Mac Developer Network.