Redesigning WORKING code into different WORKING code (also known as refactoring) is terrible.Starting with 4000 lines of brittle, inefficient, non-modular code and ending up with 1700 lines of efficient, flexible code that does the same thing, and can be easily re-used in other locations is not terrible. And yes, I've done that on code that someone else had written. (I'm sure I'd love to disavow some of the code I wrote when I first started out, so this isn't just bragging.)
Sure, if you get a comprehensive spec from day one and it never changes, odds are the code will be fairly clean on then first shot. But if, as often does "occur in nature", the coding starts before the end-user has a clear idea of what they want, and the spec changes throughout the development process, there will be sections that ought to be re-written.