Lessons learned from rewriting code
The reason that the old code might look messy to us and that it has to be rewritten from scratch isn’t actually because of the code but rather of a cardinal, fundamental law of programming:
It’s harder to read code than to write it.
Source: Lessons learned from rewriting code in my 10+ years as a developer by Huseyin Polat Yuruk.