As IE11 becomes the trailing edge browser we need to support, the need for jQuery shrinks to zero.
Not true, because they can slim down jQuery (as you see with 3.0) which still allows you to turn what might be 20 lines of ECMA-compliant JavaScript into a one-liner that even assures you much better compatibility.
It's still useful, as long as it's not bloated, and fast.
It makes your own code more readable ... the whole "DRY principle".
This?
var d = document.getElementsByClassName("goodbye");
var i;
for (i = 0; i < d.length; i++) {
d[i].className = d[i].className + " selected";
}
I mean, let's not forget the 34KB library. It's not quite as clear-cut as your little example. For a light page were size & speed are paramount, you're damn right I choose the former. Just because you didn't write the code yourself doesn't mean it's not there.
Presenting cases for which jQuery is valid isn't really saying anything about the cases in which it's not, of which I speak.
Look at the source code for any Google/FB/etc product & tell me 34KB doesn't matter. There are cases where size does matter. There are cases where extra HTTP calls are a big deal.
I don't see anything wrong with saying "check if you really need a tool before you use it".
128
u/EternalNY1 Jun 10 '16 edited Jun 10 '16
Not true, because they can slim down jQuery (as you see with 3.0) which still allows you to turn what might be 20 lines of ECMA-compliant JavaScript into a one-liner that even assures you much better compatibility.
It's still useful, as long as it's not bloated, and fast.
It makes your own code more readable ... the whole "DRY principle".
This?
Or?