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.
I think I would gladly give my left testicle to attend this class. Sadly, that was not one of the pricing options. 8) If the class is successful hope you bring it to Seattle.
Posted by: NotMyself | March 28, 2011 at 06:12 AM
I can't make it to the class, but I will buy this book as soon as you release it. WELC has been very helpful for me and my team, and your new topic sounds like it will help us even more.
Posted by: Josh Yeager | March 28, 2011 at 06:48 AM
Damnit. I'm consulting in Chicago through 4/1, then I fly out to Boston for 2 weeks on a different gig.
I'm not ready to forever sacrifice my potential to father more children (hat-tip NotMyself), but I'm a huge fan of WELC, and I'll be first in line to buy BR. Love the title, BTW.
Posted by: DSS | March 28, 2011 at 07:38 AM
... looking forward to this book. WELC already had some really useful recommendations that I could put to some use in my daily work.
Posted by: Bob Lauer | March 28, 2011 at 08:21 AM
Great news on the book.
Posted by: Colin_jack | March 28, 2011 at 08:30 AM
Wow, this is great news. Go Mike!!! :) - I can hardly wait to read it on hard copy.
Posted by: Paul Nagy | March 28, 2011 at 02:34 PM
Please don't forget to add at least one chapter for procedure language, e.g. C, as in the Legacy Code book. Thanks!
Posted by: Account Deleted | March 28, 2011 at 07:50 PM
Is there any way for "us users" to help contribute via early-access reviews? I'd love to have early access to the material and would gladly do whatever work needed to make it worth your while.
Thanks, Hamlet.
Posted by: HamletDRC | March 29, 2011 at 01:44 AM
How are you going to merge all this refactored code back??
Posted by: pablo | April 04, 2011 at 11:42 AM
So excited news! I cannot wait!!
I also want hear from you about cultural/organizational implication to good design.
Posted by: Hajime Morita | April 08, 2011 at 02:29 PM
I am huge fan of Working Effectively with Legacy Code. I am in London, cannot make it. Do you need someone to review the book or exmaples volunteerly? I will be very happy to do that.
Posted by: Khurram | April 12, 2011 at 05:03 AM
I'm really excited about this book! :)
What kind of languages will you write about?
Posted by: Ozzymcduff | April 18, 2011 at 02:13 PM
Hi
Result of your article: Refactoring Deeply Nested Code,
I'm interested in automatic tool that could convert a nested code such kind of:
(C / C++)
if (q1 && q2 || ....)
{
do_1();
if (q3 ...)
{
do_3();
if (q4 ...)
{
do_4();
...
}
else
{
do_e4();
...
}
else
{
do_e3();
...
}
}
To the type of linear code:
if (q1 && q2 || ....)
do_1();
if ((q1 && q2 || ....) && q3)
do_3();
if ((q1 && q2 || ....) && q3 && q4)
do_4();
if ((q1 && q2 || ....) && q3 && !q4)
do_e4();
if ((q1 && q2 || ....) && !q3)
do_e3();
Do you know of such a tool?
Thank you
Uri.
Posted by: Uri | October 20, 2011 at 11:05 PM
Well. try most of the other ways doesn't work for me and I learn about this here and find the best method to solve this problem and it really good.
Posted by: iPhone contacts backup | February 09, 2012 at 11:13 PM