Some types of software are much more resistant to rot than others. If your program has a URL, IP address, hostname, or file path embedded in it, those will eventually fail. If your program is compiled for (or designed for) a CPU architecture that isn't produced anymore, it's effectively rotting (even if you can run it in a VM, it's become second-class). If your program depends on OS functionality (practically all programs) that changes, it rots. If your program is designed to communicate with other processes, those processes will eventually become unavailable.
One of my favorite pieces of software is the window manager Xmonad. It's written in Haskell and is very reliable. I can't recall ever experiencing an error. Yet regrettably, I'm going to have to find a replacement eventually because X11 is being obsoleted by Wayland. It's only useful because of its dependency on X11, which in turn is only useful because of the ecosystem of software around it.
Speaking of decade old software, X11 is well over a decade old and doing well. It's evolved a good bit since, but is largely the same. In comparison though, the Pythagorean theorem was proven by the Greeks over 2000 years ago, and by the Chinese even further back, and is just as valid now as it was then. I get somewhat pensive when I consider that none of the software I've written will last remotely that long.
The analogy is a poor one though. This is nothing like rotting. A rotting thing changes, whereas here software stays the same but the environment around it changes. I know, no analogy is perfect, but this analogy is downright misleading.
I'm trying to think of a better analogy. At first I thought of stagnation, like how a river that gets blocked and can't flow gets filled up with algae and gunk.
But then what you said about software staying the same while the environment changes around it immediately made me think of evolution, Like any species that can't keep up with changes in it's environment, software that is not continuously updated to fit it's.
IMO again, this apply only along the social dimension of software. I can still boot up my decade-old computer and use decade-old software to do useful work (hell, many if not most factories do that all the time). I can be screwed over if I go on-line - either by getting pwnd, or by letting the OS update itself - but as long as I stay away from the Internet, the machine will keep working, and so will the software.
(Then again, 'smilliken turned out to be talking about much larger timescales - not decades, but centuries. There, no software artifact will survive, only its mathematical essence.)
One of my favorite pieces of software is the window manager Xmonad. It's written in Haskell and is very reliable. I can't recall ever experiencing an error. Yet regrettably, I'm going to have to find a replacement eventually because X11 is being obsoleted by Wayland. It's only useful because of its dependency on X11, which in turn is only useful because of the ecosystem of software around it.
Speaking of decade old software, X11 is well over a decade old and doing well. It's evolved a good bit since, but is largely the same. In comparison though, the Pythagorean theorem was proven by the Greeks over 2000 years ago, and by the Chinese even further back, and is just as valid now as it was then. I get somewhat pensive when I consider that none of the software I've written will last remotely that long.