3 ms·
Why spend time on learning a bad API when there is a nicer one? Ergonomics matter, but hey if you are masochistically inclined, go ahead.
by dsego 7y ago
Why spend time on learning a bad API when there is a nicer one? Ergonomics matter, but hey if you are masochistically inclined, go ahead.
- earthboundkid 7y agoBecause there is no other API. The DOM is the API. If you only know jQuery, you're shooting yourself in the foot because you can't do anything more advanced than class swizzling. You have to learn the DOM to use the web well, might as well use it directly instead of through a pair of boxing gloves. Also, I don't actually find jQuery to be nicer. It wraps its nodes in its own objects, but then you end up getting native DOM elements passed to you up anyway. It's an extremely leaky abstraction to the point that it is not nicer. As I said, if you think "document.querySelector" is a mouthful, just alias it and be done.