Coding exercises to practice refactoring legacy code
understandlegacycode.com
Coding exercises to practice refactoring legacy code
1–4 of 4 posts
Re: Coding exercises to practice refactoring legacy code
#2Re: Coding exercises to practice refactoring legacy code
#3Do not, absolutely do not do un-needed refactoring in the context of a bug fix (or feature request). I would fail a code review that did this and I would dismiss a job candidate that told me the actively look for opportunities to do refactoring like this. If your bug fix results in a new bug there is no telling what you did or why.
If you want to do a refactoring, propose it as a sprint unrelated to a bug fix. That way your bugs get fixes that are just fixes, your new features are just features and your refactoring is just cleanup. All properly prioritized. Get any of them wrong and you can understand what was the justification and how to potentially fix things or back them out.
Repeatedly muddle them all together and I would fire you.
Re: Coding exercises to practice refactoring legacy code
#4Practice writing good clean code and even do some practice refactoring exercises. That is great. Do not, absolutely do not do un-needed refactoring in the context of a bug fix (or feature request). I would fail a code review that did this and I would dismiss a job candidate that told me the actively look for opportunities to do refactoring like this. If your bug fix results in a new bug there is no telling what you d…
In that case it is good to squeeze in refactorings in the same mental area. Even so, for everyone’s sanity they should be in separate commits and ideally separate reviews, agreed.