Geeks With Blogs


Microsoft Store

Support This Site

AddThis Social Bookmark Button

Locations of visitors to this page

Subscribers to this feed

TwitterCounter for @sdorman

Creative Commons License

Scott Dorman Microsoft MVP, Software Architect, Developer, Author

There was a recent discussion on The Code Project about the virtues of refactoring. This rather quickly turned in to a question about what the difference is between refactoring and rewriting code. I have worked for a manager who loved to say "I'm confident in my ability to refactor" whenever we would talk about making sure the initial design was solid.

So, what is the difference? I think John Simmons provided the best definition. Rewriting implies that you are throwing away all (or most) of the existing code while refactoring implies that you're moving around the existing code and redesigning small parts of it.

I think the distinction between them is important, particularly in cases like I mentioned above. In that case, the "refactoring" that was being referred to was essentially rewriting the code each time because it wasn't designed properly in the first place.

Posted on Saturday, July 28, 2007 11:08 AM General | Back to top

Copyright © Scott Dorman | Powered by: