4 ms·
If you only care about writing code, sure. But in this case (as in many others), code is written just a couple of times per month, and executed millions of tim
by Shorel 8y ago
If you only care about writing code, sure.
But in this case (as in many others), code is written just a couple of times per month, and executed millions of times per day in millions of computers all around the world.
Therefore this kind of "low level JavaScript"* optimizations will have a net benefit much, much bigger than the convenience of reading shorter code for a relatively small group of people.
* Quite the contradiction, I know.
- andrei_says_ 8y agoEach computer executes it a limited number of times, with lightning speed. Differences are imperceptible. The cumulative effect you are speaking of is hypothetical. Writing code which just works on multiple browsers results in faster development and easier to maintain code and frees dev cycles to focus on performance.
- bihnkim 8y ago> frees dev cycles to focus on performance Perhaps this is the case--jQuery saved them so much time that they've reached a point where they are free to optimize their frontend by removing jQuery.
- kthejoker2 8y agoKnuth would approve. If you don't have a product, what are you optimizing?
- andrei_says_ 8y agoMaybe these are not the same developers? I know I may be replacing jquery with stimulus or eventually vuejs but writing 5 lines of jquery code for my MVP is exactly the right balance today.
- Shorel 8y ago> Differences are imperceptible. That argument sounds very postmodern. The main issue with perception is that it easily tricked and even more, it can be strongly influenced by bias. The cumulative effect can surely be measured and reasoned about. It is very different to program for your new startup idea where adding features faster than your competition is more important than anything else in order to grow your user base, compared to improving an established product already being used by millions of people. Different needs, different approaches.
- andrei_says_ 8y ago> The main issue with perception is that it easily tricked and even more, it can be strongly influenced by bias. I agree that this is an issue, mainly with all kinds of manipulation in politics and product quality/quantity/health impacts but the 5ms vs 2ms execution time of JavaScript is not one of the problems. I’d focus on humanity gleefully steering itself into a climate collapse and mass ecocide while focusing on all kinds of completely irrelevant bs.