If we had to write every single piece of code over and over(or pay for them), computer science would have barely evolved and would not be so mainstream
It is still true that people freely shared and copied sources for useful software in those days. It wasn't even called "open source" or any other kind of fancy term because it was the norm.
No, writing them over and over is literally what evolves computer science. Not having to write them over and over is what improves software. They’re different.