Re:Ignore details early on
by magnusjonsson on Tuesday January 08, 2013 @12:12AM
(#5024987)
I have found simplicity in design and thinking about performance to have a symbiotic relationship. Performance concerns prompt simplifications in the design, and simplicity in design uncovers new ways to improve performance.
Somehow you seem to assume that optimizing code would lead to complexity. From personal experience I would argue that often the code is actually clearer and more readable after it has been optimized. This is because great care has been put into it -- it's not just written and left at that, but it has been refactored with speed in mind.
Though my experience is mainly in C and C++, I guess it can be different in dynamic languages.
There's a balance. You have to optimise to some degree (writing blatantly poorly designed code is just silly), but you shouldn't over-optimize. To me, that's sort of implied in the word 'optimize.' You should start with a good design, that's well-thought-out, and you should reduce it to the simplest and clearest possible concept, but you shouldn't go overboard until you know the path.
If you optimize too soon in programming, you could run into all kinds of pitfalls. You might make the wrong thing efficient; you might spend a ton of time making the right thing efficient and then not use it; you might make something too complex by accident and it could screw you later on. So you wait to optimize.
You make the simplest solution that will work first, then optimize later, if needed. Often it's not needed.
The same should go for design, as it's an excellent fundamental principle of creation in general. Don't prematurely optimize: in other words, don't make things too complicated, too soon. Don't build something up before you have all the information. And don't build things you might not use until you know you need them. All good general rules of thumb, and they apply to all your work.