The best way to create an application that is still functioning with minimal maintenance for 10 years is to look at the systems that were built and continue to work from 10 years ago.
In my experience, most of these systems, which did not need major updates, do this by working on the same or similar equipment that they were deployed up to 10 years ago and use the same interface.
Compilers decided to opt out of improved performance due to Moore's Law or improved usability in favor of almost no maintenance over the years.
source share