Well, now that I think about it, the software going 'stale' depends on the domain.
You can write a networking stack in C adhering to a protocol and be done with it, while code for the new $COOL_WEB_APP might go out of mainstream use by the time you're done writing the networking stack.
I don't think most books, especially math and science ones go stale. A poorly written book is just that; a poorly written book. It's bad from the beginning