Paul Gielens:ThoughtsService

another Endpoint to my thoughts

News

Syndication

Ads


Favorites

Projects

Refactoring is Not Free but by doing it right, It Pays Back

At least I stirred some discussion. Sam Gentile and Jonathan Cogley where so kind to give their point of view here and here.

Sam writes:

They both largely obscure the issue and come out with blanket statements that Refactoring is Not Free, that don't make parse and don't make sense. The central issue is that both of these posts, and especially Fran's comments, and a lot of people who think Refactoring is unnecessarily expensive, are looking mostly at refactoring of entire systems/sub-systems rather that small continual refactoring of code as it is written.

To my believe there is no such thing as big refactorings, if you think there are, then I don’t know what it is you're doing, it sure as hell isn’t refactoring! This discussion is not about continual refactoring.

Sam writes:

Refactoring is small preserving transformations, not system redesigns (although Refactoring can be applied to large system changes)

A valid approach for the example I described here would be to cover a data access components, which abstract a web service, with tests. Then refactor a single method to read from a sql database instead of invoking the service operation on the web service. What I just described is a small refactoring. It takes just a few lines of code. Lots of similar small refactorings make a new system/sub-system. A redesigned system? Perhaps not.

Sam then writes:

Because all our code was all Refactored and every single class had unit tests. It cost virtually nothing

Couldn’t agree more… In my example I wanted to make it clear that this form of refactoring (yes! I’m convinced that lots of small refactorings made sequential is a form of refactoring) does cost.

Refactoring is not free but by doing it right, it pays back!

Posted: Dec 04 2005, 11:56 PM by p.gielens | with 5 comment(s)
Filed under:

Comments

No Comments