If you still need another source of motivation for taking care to write clean code, now there’s the Software Heritage Foundation. It’s a non-profit organization dedicated to preserving for the long haul all the world’s source code (or at least all the code found in public repositories like Github). It’s early days for them, but they have already archived and normalized a huge amount of code, which they make available for browsing and data mining. They’re looking for donations, as well as volunteers to help with documentation and coding adapters to repositories they haven’t yet tackled.
So now we can imagine that 100,000 years from now, there will be some archaeologists who, after browsing through the photos of you posted by your “friends” on Facebook (“Ah, look. Another one puking at a party. Why did they do that ?”), they will then run FindBugs or some more advanced analysis on your code (“How about that ? The puker’s lifetime code has 355,000 copy and pastes, a cyclomatic complexity per method of 18.7 and 23,000 abstraction leaks.”). And if you think the code you’re working on is secret, well in 50 years it will probably be in a public repository.
So take good care of your code – it will be around for a long time, and you never know who will be reading it.