A structural engineer has to get it right the first time, or people may get hurt. Nobody is going to lose their life if a SWE has some inefficient code duplication in their POC that is tested by a maximum of 5 people. There is a time for improving your work and making it more robust, reliable, and efficient — but that can often be done iteratively. Code is malleable, just don’t let it fester and rot forever if you continue to build on top of it, or you will be drowning in tech debt.