31 Days of Refactoring


 

Refactoring is an integral part of continually improving your code while it moves forward through time. Without refactoring you accrue technical debt, forget what portions of code do and create code that is resistant to any form of testing. It is an easy concept to get started with and opens the door to much better practices such as unit testing, shared code ownership and more reliable, bug-free code in general.

Day 1 : Encapsulate Collection

Day 2 : Move Method

Day 3 : Pull Up Method

Day 4 : Push Down Method

Day 5 : Pull Up Field

Day 6 : Push Down Field

Day 7 : Rename (method, class, parameter)

Day 8 : Replace Inheritance with Delegation

Day 9 : Extract Interface

Day 10 : Extract Method

Day 11 : Switch to Strategy

Day 12 : Break Dependencies

Day 13 : Extract Method Object

Day 14 : Break Responsibilities

Day 15 : Remove Duplication

Day 16 : Encapsulate Conditional

Day 17 : Extract Superclass

Day 18 : Replace exception with conditional

Day 19 : Extract Factory Class

Day 20 : Extract Subclass

Day 21 : Collapse Hierarchy

Day 22 : Break Method

Day 23 : Introduce Parameter Object

Day 24 : Remove Arrowhead Antipattern

Day 25 : Introduce Design By Contract Checks

Day 26 : Remove Double Negative

Day 27 : Remove God Classes

Day 28 : Rename boolean methods

Day 29 : Remove Middle Man

Day 30 : Return ASAP

Day 31 : Replace Conditional with Polymorphism

You can find all of the sample code available for download here: http://github.com/schambers/days-of-refactoring/tree/master

Via 31 Days of Refactoring – Sean Chambers – Los Techies : Blogs about software and anything tech!

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s