It’s simple, really :
- Know what you’re going to do from the very start. Don’t keep leaving design of the component you’re coding for “later”.
- Start small, otherwise you won’t be able to satisfy your megalomaniac ambition
- Only after you’re very comfortable with the current codebase should you go working on something more complicated