I\'ve been struggling with an application I\'m writing and I think I\'m beginning to see that my problem is premature optimization. The perfectionist side of me wants to mak
This is the right strategy in general. Get the code to work, thoroughly covered with automated tests.
You can then run the automated tests while the program is under control of a profiler, to find out where the program is spending time and/or memory. That will show you where to optimize.
And it will be showing you how to optimize working code, not code that may or not work when it's all put together.
You don't want code that fails optimally.
The quote I was failing to remember is from Mich Ravera:
If it doesn't work, it doesn't matter how fast it doesn't work.