| "the right way" I would say, don't stress about it too much. There is no perfect way. Everyone makes misstakes. And about when to make abstractions and when not, is mostly about experience. There are modules worth optimizing and abstracting. And others are not.
You definitely will make wrong decisions about it and later found out, this optimisation was a waste of time, or that quick and dirty approach really cost you much later on, we all did that and still do. Much worse than making a wrong (design) decision is making no decision at all - because mostly you have to decide for something and then just go with it.
Overthinking things seldom helps. What helps me sometimes is, putting a special hard problem to the side if I am stuck and solve something easier first. Then after some time, when I get back to it, things are much more clear. But I also wasted too much time thinking about the right approach in a neverending, neverprogressing loop to achieve perfection. Now my question is not, is it perfect or shiny, but: Is it good enough? What matters is, that shit gets done in a way that works. |
A CEO from my past often muttered that "perfect software comes at infinite cost". It's key, imo, to identify which components of what you are building _must_ be perfect. The rest can have warts.