> So, interesting and all, but it ignores the main reason for the advice to build it first, then optimize for performance, which is that if you build everything for performance from the beginning, you end up with a lot of code that is optimizing for performance of something that isn't the bottleneck. In other words, performance that doesn't show up in the user's experience, because something else is the main delay.
This isn't a question of optimizing something that doesn't need optimizing. It's about making fundamental choices from the beginning that are optimized and won't need to be optimized later.
It's the choice between using native code v.s. electron to build your app. You can make the argument that electron might be better for various reasons, but if you choose to go native, that's an optimization step you are taking.
Basically, you are saying "Premature optimization is the root of all evil" without including the rest of the quote and misreading what Knuth wrote.
> We should forget about small efficiencies, say about 97% of the time: premature optimization is the root of all evil. Yet we should not pass up our opportunities in that critical 3%.
There are certain fundamental things you can do, optimization you can do before you ever write the software. This comes from experience.
> Instead, what you get is code that is much longer, and more complex, and therefore harder to update, and more likely to be buggy.
No, this does not have to happen. In fact, if you build it first and worry about optimization later, you're more likely to end up in this state.
> How do you know what spots in the code it's worth it?
Experience. You get that from experience with code. And you can't get that experience if you are frequently changing jobs.