As I see it, there are 2 main ends of a spectrum when it comes to releasing projects that aim to solve problems:
- top-down approach: you state your problem, think it through, consider all related work in this problem space, think very hard, come up with multiple possible solutions, evaluate their trade-offs and implement the best one (a-la Hammock-Driven Design: https://www.youtube.com/watch?v=f84n5oFoZBc&t=1816s)
- rapid prototyping: you state your problem, come up with the easiest possible solution, test it, repeat (a-la Lean Development: https://en.wikipedia.org/wiki/Lean_software_development)
I know some great examples of the first approach (Clojure, Datomic, maybe Git?), but I don't know that many successes of the second approach. Furthermore, my personal work experience leads me to believe that the second approach, at least in practice, leads to a lot of wasted effort, so I'm interested to know whether it is so or not.
Rewriting code is good in my experience. It's always better the second time around (or third, or fourth). It's not that my first attempt was rubbish, it's that I didn't understand the problem as well as I did the second time (and so on).
Lean is also about avoiding premature optimisation. Which is hard because it cuts against the grain of our engineer sensibilities. Doing something "good enough for now" is tough, when you know that with just a few more days' effort you could make it bulletproof. But I've had to delete "bulletproof" code so many times, because it turns out the product didn't need that feature, or it needed to work differently.
In the long term, Lean avoids more wasted effort, in my experience.