Refactoring Triage
With a large amount of code it’s a good idea to remember the concept of triage.
Here’s one potential triage scheme:
Code which should be just deleted. This is not worth refactoring
Dead code which is not an active part of the application.
Bad functionality which complicates an application unnecessarily - negative value. See exponential complexity.
Code which should be put into a well labelled folder but not substantially altered.
This is code which we might not be ready to rewrite yet but when we do it will be a complete re-write.
Main objective of refactoring in this case is make the code easy to identify and cleanly delete at a later date so the code doesn’t become dead code.
Code which is core and needs tender loving care.
This is code which is of central importance to the application
There is no plan to replace the code and instead the code needs to be simplified and made so the entire team can understand it.
Â