One thing that's surprised me throughout my career is just how inefficient most of the code that I've inherited is. I suspect we could do a lot more with the hardware we have if we simply became better at programming.
(Perhaps more AI coaching could help?)
Given your username, I'm sure whoever inherits your codebase would share the same sentiment.
AI is trained on the same shitty code you're inheriting, so probably not.
I'm also surprised by how many developers just don't seem to care much.
Yet, the general population isn't behaving like scouts most of the time, so I suppose it's only fair that developers also aren't.
"Leave the world a better place than you found it" (s/world/code/g)