Every once in a while, people ask me whether I'm going to do a 2nd Edition of 'Working Effectively with Legacy Code.' I've dodged the question for quite a while because, on the one hand, it would be nice to move on. There are so many other things I'm interested in. On the other hand, I've learned a lot since the book was published and it would be a shame to just let that all slip away.
These days, I'm much more aggressive in my approach to old code. WELC was fully ingrained in that "if we don't have tests, we can't do much" attitude. I think that part of that was a sign of the times, and part of it was a reflection of my natural fear as a consultant. You walk in and you don't know anything about the code base so you can't even come close to accurately assessing risk. Nicely, though, people who are embedded in teams often can, and I've learned a lot from people who've tried things out long term in their code and have lived to tell the tale.
Beyond that, I've also learned at a deep level that what we call ugly code is really just code that was shaped by different forces. It's always going to bear the mark of those forces and we have to go with what is there. What software wants to be is often very different from what we want it to be. It turns out that by recognizing and aligning with these forces we can gain some leverage. Some of the funk we see in out existing code isn't going to go away, but that doesn't mean that we can't get out the pruning shears and make some rather large changes to make it all manageable.
So, what I've decided to do is organize the material I have and build it up into another book. The working title is Brutal Refactoring. The goal is describe how to take the big steps that make things easier and how to deal with software in the transition. Along with that, there are smattering of topics related to the ROI of refactoring, the economics of code change and new strategies for large method and large class decomposition.
On Monday, April 4th, I'll be teaching my first course on this material in Chicago. If you'd like to attend, there's more information here.