“Refactoring is like tidying up at home. If every time I come back from a shopping or from a business trip, I sling down my things and don’t put them away, pretty soon my house is a mess. I can’t find anything, I may end up buying new items because I can’t find the ones I know I already have. It becomes more difficult to move around the house – there are piles of stuff everywhere! I may even break something because it’s obscured by other stuff on top of it.
Refactoring is the necessary act of putting code in the right place, where other developers can find it quickly and easily. It’s keeping code organised and decluttered. Developers need to do refactoring, or they can end up with the same code in several places, which takes more effort to maintain. Refactoring is not the aesthetic organisation of the code, such as applying feng shui to your home – it’s basic housekeeping.”

Agile Coaching – Rachel Davies & Liz Sedley