Start with a rough prototype to test ideas quickly. Don't worry about making it perfect; just get it to work and learn what you need.
After your first build, take the time to create a cleaner, more polished version. You'll find it's easier because you've already discovered key challenges.
Use your initial prototype as a reference, making it easier to improve and organize your code in a way that others can understand better.