I recently started reading A Deepness in the Sky (https://en.wikipedia.org/wiki/A_Deepness_in_the_Sky ) by Vernon Vinge who briefly touches on this issue.
He speculates that eventually hardware will stabilize allowing code written over the period of centuries to still be used. He says that bugs in old code, (the original designer, coder, maintainer are dead) eventually cause more deaths than hazardous activities like space travel.
I can see how code that hasn't needed TLC for years but is still used extensively (i.e.in chains like awk and grep) could have an impact on computing for years to come.
Vinge also talks about how back doors created by the coders but forgotten over time might be rediscovered and lead to control and manipulation of massive systems that still use those old libraries.