4 ms·
I don't disagree with what you wrote, or the spirit of its meanings. But optimizations in a modern sense seldom means implementing a section in assembly. In mo
by endorphone 9y ago
I don't disagree with what you wrote, or the spirit of its meanings.
But optimizations in a modern sense seldom means implementing a section in assembly. In most cases it means a skillful, well-considered use of appropriate technologies, appropriate algorithms (e.g. a hash table instead of a simple linked list for a lookup heavy section, appropriate database designs, etc) and a coherent design.
When you start from day 1 thinking "performance matters", it doesn't and shouldn't demand any added complexity. But it does demand constant consideration as implementing requirement.
Of course the counterpoint is that of course we should use appropriate technologies, algos, designs, etc. Who could argue otherwise? But whenever I've seen the premature optimization boogeyman appear in a modern context, it is usually in the context of just such a discussion. A sort of "performance is a concern for another day".
- deleted 9y ago[deleted]
- rgbrenner 9y agoI don't consider appropriate use of algos (where no additional development cost is incurred), and coherent design to be optimizations. I'm not sure how to respond to this. You're using a definition I've never heard before.. this sounds like basic competency being called optimization. Nothing I've written here should be misconstrued as an argument in favor of sloppy code.
- endorphone 9y agoThis is the cycle of every "premature optimization" discussion, ever. Someone discounts optimization, but when countered with optimizations states that they aren't actually optimizations. Your root post states "In fact, most code doesn't need to be optimized at all". That is de facto meaningless if we go under the assumption that optimizing itself -- ergo implementing optimally -- doesn't count as optimizing.
- deleted 9y ago[deleted]
- rgbrenner 9y agoYou've thrown a lot of stuff under the label of optimization. Take coherent design. I started off saying everything should be written for clarity, and having a coherent design is part of that. A coherent design can mean the code has lower performance than an incoherent design. How could this possibly be considered an optimization? An optimization now includes things that reduce performance?! Edit: Also "implementing optimally" is not the definition of optimization. optimal: "best or most favorable." optimize: "rearrange or rewrite (data, software, etc.) to improve efficiency of retrieval or processing."
- endorphone 9y agoI think you should revisit the line in the linked page that you disagreed with so strongly. It doesn't say "go back and rewrite in assembly", but simply asks that you develop with performance in mind (with an awareness of the costs of the choices you are making). Your comment was that performance effectively doesn't matter, deal with that later. Optimization in the context of "premature-optimization" doesn't refer to going back and rewriting code early. It refers to a mental concern about performance, where there is a very wrong, but persistent and common, attitude that performance is something you can add later. But in most cases that simply isn't true, and it's one of the biggest lies in this industry, trotted out like it's grizzled experience and wisdom when it's the foundation of countless project failures.