3 ms·
You love extra typing for no reason? I see the point but jQuery is still much more concise.
by icedchai 12y ago
You love extra typing for no reason? I see the point but jQuery is still much more concise.
- smt88 12y agoTyping is pretty minimal when you use a good IDE with autocomplete. I never type the word "document" -- just "d" and then enter. (Note that vanilla JS has great autocomplete support out-of-the-box in many IDEs.) The vast majority of development time is spent dealing with people, reading code, learning, or maintaining code. Typing is a very small part of it, and I remember seeing a study recently that confirmed it. If you hate typing that much, just write simple wrappers around vanilla JS, e.g. $.el = function (id) { return document.getElementById(id) }; What's more, when you're writing a complex web app using JS libraries, all of those milliseconds you lose in performance are going to add up (especially on mobile!)
- icedchai 12y agoThose "simple wrappers" are already provided to me by using jquery, etc. Why would I waste my time writing my own? (I realize a lot more is also provided.) The getElementById is really the most simplistic example and actually does not bother me. Though just look at all the cruft required to make a AJAX call with "vanilla" JS. It's gross. Use a well known, standard library and abstract it all away.