Legacy code can be refactored if tests are written, even if the code is awful. Without tests, wonderful code is also difficult to change. There are four main reasons for changing software: adding features, fixing bugs, refactoring, and optimizing. The challenges in changing code are determining what to change, confirming the change is correct, and ensuring nothing else is broken. Not changing legacy code over time increases these risks and makes the code more complex and harder to work with.