But where software does fail in my humble opinion is making it easy to pull in tried and true tested solutions to the problems that we do face, even if they are not as common. Because even though they may not seem common, I'm absolutely certain many face the same scenario.
The amount of duplication solving the same problems is insane. But this is not an easy problem to solve and I don't intend to trivialize it.
I think we need to come up with better tools. code sharing through libraries/repositories (like npm) is great, but it can't be the final solution.
Back in the day in Haskell I dreamed of a system where you could type out a type signature and a fully tested rated implementation would be imported from an "open source" service. You could import modules, functions, data structures, anything. But that vision is still a long ways off.