Experiences with dealing with legacy code while delivering value. Key points: 1) Legacy code costs a lot. 2) Design must be maintained & evolved. 3) Continous refactoring during each task is a way to achieve 2.
Refactor!The only way out is to improve the design
?How do we get from L to R? The sad answer is we dont.It took centuries to build R. We can never get from L to R in a reasonable time. Thereis too much mess, too much to fix.
Code Churn Michael Feathers: Getting Empirical about RefactoringCode-churn driven refactoring: improve where it matters & pays off most - complex &changed often
=> Boy Scout Refactoring ● Only task-related ● Time-boxed ● Always ● (+ TDD)Refactoring can go on forever => focus, time-box. Task related => in code thatmatters most now/in near future. (We: 1/3 every task devoted to refactoring.)
Refactoring: Improving the Design of ExistingCodeMartin FowlerWorking Effectively with Legacy CodeMichael Feathers Behead Your Legacy Beast: The Mikado Method D. Brolund, O. Ellnestam