Coding exercises to practice refactoring legacy code
understandlegacycode.comPractice 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 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.
Unfortunately in many places tasks that don’t fix bugs or create features never get assigned. Stupid, but still.
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.
Does anyone know of an online community to practice these exercises doing pair programming?