5 ms·
I’d be careful about premature optimization. If you can write your code 2x faster by using jQuery, by all means do it. Eventually, if needed, you could rewrite
by human 6y ago
I’d be careful about premature optimization. If you can write your code 2x faster by using jQuery, by all means do it. Eventually, if needed, you could rewrite your JS to be free of jQuery, but it would not be a priority for me. Dev speed if more important than load speed for me.
- abiogenesis 6y agoWhat we need is a Jquery-to-VanillaJS transpiler.
- paxys 6y agoUh, what do you think jQuery is written in?
- HatchedLake721 6y agoReact?
- noisem4ker 6y agoThe point is doing the translation on the server.
- abiogenesis 6y agojQuery is written in JS, but if your code is using jQuery functions you are not writing "vanilla JS" anymore. Otherwise we wouldn't need the term "vanilla JS". What I meant was inlining the jQuery calls to their equivalent JS snippets, removing the need for including a 80K library if you are not overly dependent on jQuery. It was also a tongue-in-cheek comment.
- austincheney 6y agoThat’s not premature optimization: https://en.m.wikipedia.org/wiki/Program_optimization#When_to_optimize https://en.m.wikipedia.org/wiki/Program_optimization#When_to... If your code can execute 10x faster without jQuery then the optimization is not premature. If a developer takes twice as long to write any code the problem isn’t optimizations at all.
- ozim 6y ago"optimization - an act, process, or methodology of making something (such as a design, system, or decision) as fully perfect, functional, or effective as possible" If you optimize process of delivering feature to the end user then using JQuery is optimization and not premature. It does not have to be optimization of runtime/load time.
- glckr 6y ago> If your code can execute 10x faster without jQuery then the optimization is not premature. One could argue that it is premature if the code doesn't _need_ to run 10x faster.
- austincheney 6y agoOne could also argue that driving to work is premature if you have two perfectly good legs. All ridiculousness aside a person can invent any absurd excuse to hide from the common practices of their profession.