Refactoring: Comment it out vs small steps removal
One refactoring I was doing last week was to try and remove the use of some getters/setters on one of our objects so that it was better encapsulated and all the behaviour related to it happened in one...
View ArticleRefactoring: Removing duplication more safely
One of the most important things that I’ve learnt from the coding dojo sessions that we’ve been running over the last six months is the importance of small step refactorings. Granted we have been...
View ArticleSafe refactoring: Removing object initializer, introducing builder
I previously wrote about an approach we took to safely remove some duplication and I recently followed a similar mantra to replace an object initializer call which had around 40 properties being setup...
View ArticleConsistency in the code base
I’ve had quite a few discussions with various different colleagues about coding consistency over the last year or so and Pat Kua and Frank Trindade have both written posts suggesting that we should...
View ArticleRefactoring: Small steps to pull out responsibilities
I wrote previously about how I’ve been using effect sketches to identify responsibilities in objects so that I can pull them out into other objects and once I’ve done this I often find that I can’t see...
View ArticleSmall step refactoring: Overload constructor
I’ve previously written about some approaches that I’ve been taught with respect to taking small steps when refactoring code and another approach which a couple of colleagues have been using recently...
View ArticleConsistency in the code base and incremental refactoring
I wrote a post a while ago about keeping consistency in the code base where I covered some of the reasons that you might want to rewrite parts of a code base and the potential impact of those changes...
View ArticleIncremental Refactoring: Create factory method
Dermot and I spent a bit of time today refactoring some code where the logic had ended up in the wrong place. The code originally looked a bit like this: public class LookupService { public LookUp...
View ArticleRuby: Refactoring from hash to object
Something I’ve noticed when I play around with Ruby in my own time is that I nearly always end up with the situation where I’m passing hashes all over my code and to start with it’s not a big deal....
View Article