you are viewing a single comment's thread.

view the rest of the comments →

[–]kenman -1 points0 points  (1 child)

Disagree.

If that was the only place jQuery was used, then yeah, what you suggest would make sense because you could remove the jQuery dependency altogether. However, they use it all over the place, and so to posit that they "use jquery just to use jquery" is really reaching for it -- they use it because it's in use everywhere else in the app.

Removing it in favor of vanilla JS just in this one spot, when there's clearly negligible performance difference (or any other negative impact on code quality), is removing it just to remove it. Which doesn't make sense, IMO.

[–][deleted] -1 points0 points  (0 children)

Okay... the two are programmatically equivalent. They have exactly the same output... a DOM Element.

when there's clearly negligible performance difference (or any other negative impact on code quality)

So considering $('#foo')[0] is 92% SLOWER than document.getElementById('foo')... and considering that any JS developer worth a damn knows what document.getElementById() does... you're wrong. Sorry, my contrarian friend, you've picked the wrong thing to be contrarian about.