Review – Working Effectively with Legacy Code
Working Effectively with Legacy Code, Michael Feathers. Prentice Hall, 2004.Michael has distilled a lot of knowledge about how to safely improve code when you lack the safety net of tests. For...
View ArticleReview – Refactoring to Patterns
Refactoring to Patterns, Joshua Kerievsky. Addison-Wesley, 2005.Design patterns and refactoring have been related for a long time. (Consider that Ralph Johnson, one of the co-authors of Design...
View ArticleReview – Refactoring Workbook
Refactoring Workbook, William Wake. Addison-Wesley, 2003. [Consider this a summary rather than a review my own book.] My goals were to create a workbook that helps people practice recognizing smells...
View ArticleSmell to Refactoring Cheat Sheet – Industrial Logic
Joshua Kerievsky has made available Industrial Logic’s "Smell to Refactoring Cheat Sheet." (http://industriallogic.com/papers/smellstorefactorings.pdf)
View ArticleRefactoring Demo Screencast
Four ways to Extract Method. Refactoring is "improving the design of existing code". We want to do this quickly and safely, so that we're improving the code's design but not introducing bugs while we...
View ArticleRefactoring Workbook
Premise "Refactoring improves through practice." The Refactoring Workbook contains exercises to help you assess and improve your ability to refactor (Java, but close enough for C# too). It's available...
View ArticleReview – Clean Code
Clean Code, Bob Martin, Prentice-Hall, 2008. Bob Martin tackles the challenges of making code sparkling clean. He provides numerous guidelines, and demonstrates their utility in action. I particularly...
View ArticleRefactoring in Ruby – InformIT Interview
Interview with Bill Wake and Kevin Rutherford, the authors of Refactoring in Ruby. Continue reading →
View ArticleArticle: When Software Smells Bad
Kevin Rutherford and I wrote this article for Better Software magazine; it was the cover article in the July/August 20122 issue. It demonstrates refactoring in Ruby, using a basic "todo" list...
View ArticleResources on Refactoring
Refactoring is a key skill in developing software. These resources can help you improve. If you just want practice with refactoring, choose some Exercises. If you’re just starting out, consider the...
View ArticleRefactoring: Pull Common Code from Conditional
We’ll look at two refactorings suitable for conditional statements: Pull Up Common Head of Conditional and Pull Down Common Tail of Conditional. I originally learned these as performance optimizations...
View ArticleLimits of Refactoring: What IS Behavior?
Martin Fowler writes, “Refactoring is the process of changing a software system in such a way that it does not alter the external behavior of the code yet it improves its internal structure.”...
View ArticleThe “Call Your Shots” TDD Workflow
Kent Beck’s TCR workflow experiment has generated some good discussion. Rachel Carmena has documented several TDD workflows. I’d like to add an approach that I’ve used for a while: “Call Your Shots”....
View ArticleHome-Grown Refactorings – Be Careful!
When you clean up code, you often need refactorings that aren’t in any tool, and aren’t in Martin Fowler’s Refactoring catalog. You’re on your own. When this happens, think like a language lawyer and...
View ArticleRefactoring and Generalization in TDD
This article (originally published in Better Software) explores generalization in TDD. The basic notion is that refactoring sets out to not change the behavior of code for any of its inputs, but TDD...
View ArticleExtract Protocol Refactoring (Swift) – Elevate Common Behavior
Extract Protocol lets us generalize our types. Context: You have a class (or other entity), and want to let another class stand in for it in some cases. You could make the other class a subclass. But...
View ArticleDivide Class into Class + Extension (Swift Refactoring)
Context: You have a class that implements one or more protocols. The class has become long, and it’s confusing to understand what parts are there for the protocols, and what parts are for the class’...
View ArticleRefactoring in Swift
This post summarizes the material on xp123.com related to refactoring in Swift. Swift Refactorings Divide Class into Class + ExtensionExtract Protocol Other Refactoring-Related Material Refactoring –...
View ArticleSpeculative Generality
For most problems, we have a choice: implement current needs only, or generalize the solution to more easily handle variations we expect to need in the future. The evolutionary design community refers...
View ArticleRefactor: Change Signature on a Protocol [Interface]
When a “raw” type appears in a protocol, it encourages it to spread all over. Recently, I needed to encapsulate a type: I had used “array of integer” ([Int]) in a number of places, and I wanted to...
View Article