Monday, January 16, 2006

Refactor all the way

After using BDS 2006 for three weeks now I must say it is a real piece of art. I can not think of one reason to go back to Delphi 7. For me the most valuable new features are the improved and extended refactorings. It takes some time to get used, using them, old habbits just don't disappear that easy :-) I guess.

What I always found a bit annoying in Delphi coding was the fact that changing the parameters of an existing method, meant a lot code cruising. OK, you can't have it all but figure this:

In Delphi 7, to change a parameter of a method you should do something similar like this:

1. Change the parameter in the implementation section (iow the method)
2. Surf (Ctrl-Click) to the interface section to change the decleration
3. Ctrl + Arrow Down to go back to the implementation

Delphi 2006, and in specific Together, dramatically improved things. With refactoring you can now change the parameterlist of a method, and Together will take care of changing the declaration (or vica versa)!

The 'Change Parameters' refactor dialog:


With this dialog you can add or alter parameters in a very easy way. Other 'My favourite' refactorings are:

  • Extract method (Existed already in D2005)
  • Find unit (Helps you finding the unit for the uses clause)
  • Declare variable

The new and improved refactorings in BDS 2006 boost productivity, no doubt about that. This and the other editor improvements, like Live templates, made upgrading to BDS2006 worthwhile.

No comments: