3 ms·
I work with smalltalk and java/eclipse so what I say come from this background. With statically typed languages and a IDE to aid, refactorings like rename, pull
by beothorn 15y ago
I work with smalltalk and java/eclipse so what I say come from this background.
With statically typed languages and a IDE to aid, refactorings like rename, pull up, pull down, extract interface and such can be done without changing the code behaviour (if your code don't use reflection).This is a characteristic of statically typed languages, not IDEs, but IDEs can do it automatically.
You could do this refactorings without a IDE, but not with text replace. For example, if you need to change the name of a method, category(), and two unrelated classes implements it, your refactor using text replace will change the method signature for both classes. You need to check every place where the code will be changed, and if your codebase is too big with too many calls, this is nearly impossible. The IDE rename the method calls based on the varible type, without risks of errors, if the refactoring is not possible eclipse warns you.
- philwelch 15y agoPresumably you still have someone review the automated refactor, right? Plus, smalltalk isn't a statically typed language.
- Arelius 15y agoYes or no. Static code transformation with well defined equilivency is many orders of magnitude more reliable than the error finding rate of a code reviewer. You still review to make sure it was an improvement, and to make sure that the person making the changes didn't make the mistake. But you don't review the correctness of the transformation itself, at least not any more than you need to review the original code.
- beothorn 15y agoNever said that smalltalk is statically typed, I said I work with both on my job. A refactoring don't change the code behaviour by definition. I don't need someone to review my refactoring to look for errors from an automated refactoring, maybe to tell me that the refactor didn't improve my code.
- r00fus 15y agoIsn't this what automated unit and performance testing is for? If a refactor (or any code change) causes slippage on any of those indicators it should be flagged or rejected.