Software Lifespan

How long should our software last? I'm sure that there are software packages out there that were built decades ago, but I'm talking about packages still being actively updated and sold. Personally, I figure if I get 5-7 years out of system before a major refactor of some part of it, then I'm doing great. Even if you continuously refactor, you will eventually get to the point where the cost of new features in legacy code become prohibitive. Shortcuts are taken or information is lost, and the result is code that is tough to maintain and update. How long do you think code lasts before it's too expensive to update?

The recent Mars Lander story made me think about this. Talk about a huge pat on the back to those NASA engineers. They built a system meant to last 90 days that ended up lasting almost 2000 days. Who knows? If it can survive the Martian winter, it may be able to keep going. The Devil's Advocate in me might say that they grossly over-engineered it, but mostly I'm supremely impressed the a group of engineers built a machine that survived in a very hostile environment for 5+ years.

From http://xkcd.com/:

Mars Lander Chronicles