News for hackers. Stuff that matters.
Re:Removing jQuery from GitHub.com frontend by austincheney on Thursday July 26, 2018 @05:20AM (#17616116)
It isn't about writing code. As a developer writing code is your job. If writing a couple of extra lines of code makes you sad then perhaps this isn't your cup of tea.

For me it has always been about performance. jQuery is slow. Even way back in the day before JavaScript got fast you could access the DOM quickly if you knew what you were doing. Likewise DOM access could easily make your code 5 times slower if you didn't know what you were doing.

Since 2012 JavaScript has been fast in every major browser and querySelectors are a standard feature. Since about that time accessing the DOM has always been 10s-100s of times faster than using the standard querySelectors. In Firefox it is 10s of thousands of times faster. The standard querySelectors are faster than using modern jQuery.

To me this is the difference between a junior developer and a competent developer. Some people NEED the extra help. I understand that. If product quality and achieving a superior user experience are important though you will simply figure out a better way of writing code, especially since writing code is probably your job.

Re:Removing jQuery from GitHub.com frontend by yAnonymous on Thursday July 26, 2018 @06:00AM (#17616263)
Software development is a lot about making good use of resources and if you reinvent the wheel for every job you do, maybe it isn't your cup of tea.

I've worked with developers who completely ignored good libraries and instead created their own terrible implementations. They got nothing done and what they did was a buggy mess that often needed months of patching.

Finding a good middle ground is the best way to go and when the loading time increases by only a few milliseconds, but the development is a lot faster and cheaper, that's a good compromise in most cases.

Re:Removing jQuery from GitHub.com frontend by austincheney on Thursday July 26, 2018 @09:19AM (#17617188)
Cliche ad nausium. It’s like saying I should never have to write my name more than once, because it is reinventing the wheel.

In this case every call to the DOM goes from a slow baby crawl to rocket speed. In no other aspect of life do people make such empty excuses, using cliches no less, to intentionally remain in the stone age.

Re:Removing jQuery from GitHub.com frontend by talmand on Thursday July 26, 2018 @11:00AM (#17617977)
Well, considering there are devices out there for the purpose of signing names repeatedly, I would say your example doesn't necessarily work.

Totally depends on the situation.

And why the assumption that modern versions of jQuery don't make use of modern DOM APIs?

Re:Removing jQuery from GitHub.com frontend by austincheney on Thursday July 26, 2018 @11:12AM (#17618073)
Here is what makes jQuery slow, both now and in the past:

* querySelectors (standard or the home grown Sizzle engine)

* Method chaining for trivial tasks, in many cases to compute data that is already statically present or directly assignable.

Regardless of whether jQuery is using modern APIs or not there are old standards available, to JavaScript, that just about everything in jQuery eventually compiles down to. At the end of the day it becomes a matter of whether writing a couple of 3 line abstractions is far too hard of work or whether it is simply easier to push everything through 65k of jQuery purely for the sake of familiarity.

Re:Removing jQuery from GitHub.com frontend by posting2fast on Thursday July 26, 2018 @06:24AM (#17616338)
"friend to your coworkers, enemy to your craft"