3 ms·
Agree. Actually design patterns are really good to apply at refactoring time. You often cannot foresee what problems you will be facing and how your code will e
by vlado 16y ago
Agree. Actually design patterns are really good to apply at refactoring time. You often cannot foresee what problems you will be facing and how your code will evolve in order to start trying to stuff in all the patterns you are familiar with. Write code -> see a problem -> identify a possible pattern -> refactor accordingly. This is also learning design patterns by doing.
- hga 16y agoI've found that Anti-Patterns (http://en.wikipedia.org/wiki/Anti-pattern http://en.wikipedia.org/wiki/Anti-pattern) are the best approach for refactoring. They explicitly start with recognizing a bad pattern (frequently one which once made sense but no longer does) and then explicitly prescribe methods to refactor them into something better.