Ask HN: What's the most stable form of digital storage?
If the question is literally about just one program source code, the answer is easy: print it out.All my oldest preserved code (early 80s) is on paper, the things it occurred to me at the time to print out. No fancy archival paper either, just listings printed out on my dot matrix printer onto fanfold printer paper.Anything from that era that I didn't print out is gone.From the late 80s onward I still have all the files that I've cared to save. The general answer to that is that there is no persistent medium, you need to commit to keep migrating that data forward to whatever makes sense every so often.I copied my late 80s 5.25" floppies to 1.44MB floppies in the early 90s.
In the mid 90s I copied anything accumulated to CD-Rs.
In the 2000s I started moving everything to DVD-Rs.From the late 2000s until today I have everything (going back to those late 80s files) on a ZFS pool with 4-way mirroring.Of course, aside from preserving the bits you also need to be able to read them in a future. Avoid all proprietary formats, those will be hopeless. Prefer text above all else, that will always be easily readable. For content where text is impossible, only use open formats which have as many independent open source implementations as possible to maximize your chances of finding or being able to port code that can still read the file 30-40 years from now. But mostly just stick with plain text.