About the author

Rob Schieber is a developer in Columbus, Ohio.
E-mail me Send mail

Recent comments

Authors

Disclaimer

The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

© Copyright 2008

The P.G. Wodehouse Method Of Refactoring

I came accross a pretty good post on refactoring today on Basildon Coder.  The post offers some sound advice on when and how to refactor code.  I found the following paragraph quite insightful regarding completely rewriting existing code. 

"The problem is that warty old code isn’t always just warty - it’s battle-scarred. It has years of tweaks and bug-fixes in there to deal with all sorts of edge conditions and obscure environments. Throw that out and replace it with pristine new code, and you’ll often find that a load of very old issues suddenly come back to haunt you."

All too often we come accross code we don't like.  I've come across some real gems in my career, and I am positive that I have created some truly horrible code in my life.  I think that the first reaction that we have when we see ugly code or poorly designed systems is to push for a complete rewrite.   This is a normal reaction, but I think that a complete re-write should really only be used as a last resort.  It will always be a bigger task than it initially seems.  The best choice, and often more challenging is to figure out a way to refactor the problem code.


Categories: Refactoring
Posted by sheebz on Friday, June 27, 2008 10:40 PM
Permalink | Comments (0) | Post RSSRSS comment feed

Related posts

Add comment


(Will show your Gravatar icon)  

  Country flag

[b][/b] - [i][/i] - [u][/u]- [quote][/quote]



Live preview

Monday, October 06, 2008 6:35 PM