Refactoring is not Rework

Prompted by a brief twitter exchange, it’s worth reminding ourselves what refactoring is.

If you think it means spending an hour at the end of a day putting things right, a day tidying things up at the end of an iteration, or spending an iteration at the end of a project cleaning up the code, you’re dead wrong.

Refactoring is a continual activity, part of how we work with code every minute of the day. It’s a key element of what Kent Beck calls responsive design, the work we do moment-by-moment, test-by-test, to keep the design of the product we’re building as simple, clean and honest as possible.

Every time we say to ourselves “I’ll refactor that later” we’re not talking about refactoring, we are indeed talking about rework. But it would be a pity if the confusion that appears to beset the majority of people when they talk about refactoring were to spoil our use of a perfectly good word with — to my mind — a very clear meaning.

No Comments

Add your own comment...