I’ve been following the javascript questions here for the last few weeks, and I’ve found a common recurring theme.
Almost any question asked on here that involves JavaScript gets answered with:
- “jQuery can do that”
- “there’s a plugin for that”
- “jQuery can make your bed for you.”
Even questions referencing other libraries are answered by saying “Use jQuery instead”.
Is jQuery replacing JavaScript as a whole?
This is a serious question. Are we really looking at JavaScripts future. Obviously this community has a strong bias towards jQuery (is that because there’s alot of .NET developers?), but does the web development community as a whole share this bias?
I think jQuery can’t replace JavaScript for a very obvious reason. It’s because jQuery doesn’t solve a single problem in JavaScript – the language. It only solves problems with inconsistent DOM implementations between browsers which is its biggest strength and it comes with some syntactical sugar.
jQuery can’t also replace the DOM APIs for another obvious reason. jQuery – the library, is controlled by one organization and primarily one man. DOM, on the other hand, is a spec that is implemented by tons of vendors while jQuery is merely a wrapper around the various implementations of that spec.
If jQuery were to replace these DOM APIs, then it will have to be a spec because different browser vendors can’t just take its code and shove it in somewhere and make everything work nicely. The browser engine might be in C, C++, Java, or GolfScript so it becomes absolutely necessary for it to be a spec rather than an implementation.
Once jQuery API’s become the de-facto standard and gets laid out in a spec, it will face the same problem that the specs face now. You can’t just be a core-committer who fixes a problem overnight and releases a new version say 1.4.3 of the spec. The spec has be discussed, agreed upon, changed, released, and all implementors have to update their codebase to comply which makes the entire process slower. It also loses the ability to fix cross-browser quirks because it doesn’t get to control that since its operating at a higher level in the food chain.
Then, because of it being a spec and moving slowly, you can always come up with your own library
*Querythat simplifies the spec APIs even further, fixes cross-browser issues, and move at a much faster pace.This is why jQuery can’t replace the DOM API because if it does, it will stagnate rather quickly as better, more innovative, and competing abstractions spring up every single day.