the.com/refactoring
rewriting code so it does exactly the same thing, only less embarrassingly.
means restructuring existing code to improve its internal design without changing what it outputs.
from formalized in the 1990s by martin fowler and kent beck, though programmers had been quietly tidying their messes long before it got a fancy name.
martin fowlerwrote the book that named the practice, 1999
tests requiredsafe refactoring needs tests to prove nothing broke
not a rewritebehavior stays identical, only structure changes
technical debtrefactoring is how you pay the interest down