Define "better"? If all you want is for your code to do X, then all things considered, getting it to do the X for you as soon as humanly possible is a perfectly sensible goal to have.
On the other hand, if after getting it to do X you came to realize that what you actually want is X + Y, but changing anything in the spaghetti mess you've coded up up to this point is an excruciatingly painful experience; which made you realize in turn that what you actually actually wanted was to retain the ability to change, swap, replace, modify, update, alter, test, delete, and remove any one piece of it with the minimum amount of friction and/or cognitive load; in other, more traditional terms, to be able to maintain your code, going forward; then I reckon you already know the answer.
Neither approach is "inherently" superior to the other. Hell, with the way a solid chunk of the entire industry today already only caring about the number of LoC you can pump out with the help of the latest/greatest token predictor out there, one could argue that the only thing that matters is the result. I'd humbly disagree, but then I'm not a CEO and/or an investor in any of the trillion-dollar valuation behemoths ushering us into the new "age of AI", so what would I know?
For learning, understanding, maintaining, and retaining the "ownership" of your project, however - I'd definitely recommend spending some time up front thinking, planning, and accounting for the likeliest vector of change your codebase will be subject to for all the foreseeable future. It might make things much easier, and simpler, and a whole lot more bearable to boot.
In the beginning, all you want is results. In the end, all you want is control. /src