Disagree. I feel like I have seen this play out a number of times in my career:
- New engineer joins a team with a mature codebase
- New engineer complains about code quality, convinces management on a total rewrite to improve code quality
- New codebase starts out simple and elegant
- Eventually the codebase gets just as bulky and convoluted as the old one, because the ugliness was just a reflection of the complexity of the problem space
A lot of times "ugly" is just a stand-in for "not written by me"
I think your mistaking technical debt for code quality.
I've seen the same thing play out and more often than not, its a helix like cycle of projects starting simple and as time goes on trade offs are made and you get a lot technical debt then you rewrite and the cycle begins again.
I partly agree with you about "ugly=not written by me", I just think that only happens at the edges aka semantics.. Nowadays its pretty easy for teams to come to a consensus on whats clean/ugly vs acceptable/subjective.
I partially agree that there is a cyclical aspect to code rewrites and cruft accumulation. I still think a lot of time the perception that code is poorly written gets applied to complexity which is not yet understood rather than objectively poorly written code.
- New engineer joins a team with a mature codebase
- New engineer complains about code quality, convinces management on a total rewrite to improve code quality
- New codebase starts out simple and elegant
- Eventually the codebase gets just as bulky and convoluted as the old one, because the ugliness was just a reflection of the complexity of the problem space
A lot of times "ugly" is just a stand-in for "not written by me"