November 08, 2007
Refactoring - the Dark Side

All this refactoring is all very well, Martin, but there is a cost. When a piece of code that you are currently working on gets refactored out from under you, you can end up with the merge from hell. I've just spent two hours merging a perfectly sensible set of refactorings into a change I'm making. Methods were renamed and moved, all to better names and places, but the changes were well beyond what Suvbersion can deal with automatically.

What's the solution to this? I have no idea. ;-) Certainly the refactoring of code that is hard to understand or maintain is necessary if you are to keep your code-base workable.

One piece of advice is to check in little and often. This doesn't make the issue go away, but does limit its impact.

The other thing is to bear in mind the potential cost of the refactoring that you are doing. Renaming that isPlayable() method to isVideoPlayable() might not be such a good idea, even if it is a better name, if it's going to cost someone hours of work.

Posted to Agile by Simon Brunning at November 08, 2007 01:33 PM
Post a comment

Email Address:



Remember info?