In software, we have the principle: "Make it work; make it right; make it fast".
First you get it to exist and do the thing at all. Then you improve the form and style from the likely pile of hacky shit you started with. Only after all that do you try to optimize or tune it.
