Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> Had they learned vanilla javascript first

Vanilla Javascript has nothing to do with DOM APIs. DOM APIs is just another interface/library/abstraction that you need to learn after you've learned JS.

> If you learn jQuery today, you're not learning core JavaScript

DOM APIs are not core Javascript.



You are right, but it's kind of beside the point given the context is web libraries. jQuery is built on top of the DOM API, so it's a library on top of an abstraction. It is just as simple to learn, so why not learn the core abstraction, with which all other DOM based abstractions are built from?

jQuery will eventually go away while the DOM API is part of the web's core stack. Maybe it changes over time, but there will likely be a DOM API as long as there are HTML based browsers.


I agree that learning the DOM API is an important core skill for web developers. But not that you should avoid using jQuery.

jQuery, or something like, it will be around "forever" because a core problem it solves is inherent to the DOM API.

("forever" actually means for the foreseeable future, projecting out where trends will take us in the future.)

The core problem is, there is no DOM API... there's a collection of DOM APIs which overlap (a lot) but that have various differences from browser to browser and from release to release. Just as importantly to software development, the wholly stable parts aren't really a single API either, but a group of APIs with a lot of duplication and variation in the patterns and idioms used.

For good software of any complexity, you're going to want to build as much of your code as possible in terms of a simple, concise, consistent, stable foundation and the DOM API is not those things. It doesn't have to be jQuery.

(BTW, I'm mainly talking about application-level code here. For utilities, plugins or other lighter-weight libraries, NOT requiring a separate library is a significant advantage. And your DOM access may be limited and well-defined so that a vanilla approach isn't burdensome.)


> You are right, but it's kind of beside the point given the context is web libraries.

I don't think it is.

> so it's a library on top of an abstraction. It is just as simple to learn, so why not learn the core abstraction, with which all other DOM based abstractions are built from?

DOM APIs are not as easy to learn. They are verbose, cumbersome, inconsistent in behaviour and capabilities. Even the staunchest evangelists of the "use the platform" movement run head over heels to anything that frees them from DOM APIs [1].

There's nothing wrong with learning jQuery (or any of the other libraries or frameworks) first, and then learn the core APIs to see how stuff works (and run away in horror). However, they are not a prerequisite for "vanilla js" or "core JavaScript".

> jQuery will eventually go away while the DOM API is part of the web's core stack.

That's the end goal of jQuery: to become the disappearing library. That is, to become irrelevant when the capabilities it offers appear in the browsers themselves. However, this will never happen as long as w3c goes out of its way not to offer any APIs with a sensible developer experience.

----

[1] You can see it in Web Components where "use the platform" is immediately abandoned the moment lit-html hits the scene or Template Instantiation is proposed.


> That's the end goal of jQuery: to become the disappearing library.

I guess my argument is simply that for the most part it's already happened, there is nothing particular scary about "jQuery style" general usage of the platform APIs.

Anything more complicated and I would prefer to enlist libraries other than jQuery. Drag and Drop, animation, AJAX, UI, all have libraries I would prefer. For anything less complicated I can just use what's currently in the platforms. For animation, CSS and class toggles are usually enough. Anything more complicated and there are better libraries for that.

> Even the staunchest evangelists of the "use the platform" movement run head over heels to anything that frees them from DOM API

Tongue in cheek but, that might make me the staunchest then, because I developed a workflow for using Web Components that uses only the spec, includes templating, data binding and is very simple. Shame it only works in firefox!

> There's nothing wrong with learning jQuery first

Practically speaking probably not, and you could make it through your entire career jumping from jQuery to React or Vue or whatever is next and never learn the platform APIs. I don't think there's anything wrong with that either. But if it's a hobby or your passion for web technology exists outside of work, I really do think you would be doing yourself a disservice not to thoroughly learn the platform.


> Drag and Drop, animation, AJAX, UI, all have libraries I would prefer. For anything less complicated I can just use what's currently in the platforms. For animation, CSS and class toggles are usually enough. Anything more complicated and there are better libraries for that.

And that's the thing: there are always libraries. There are very few use cases where you want to use DOM APIs directly. They all but sream "use a lib/wrapper/framework".




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: