3 ms·
There's a lot of nifty front-end JS frameworks these days, or popular front-end and back-end JS implementations, so I can see how it's easy to miss what made/ma
by randomdrake 11y ago
There's a lot of nifty front-end JS frameworks these days, or popular front-end and back-end JS implementations, so I can see how it's easy to miss what made/makes jQuery great.
I think that it's hard to truly appreciate jQuery unless you were actually attempting to write code for web applications that dealt with a lot of JavaScript at the time. 2005 and 2006 was a nightmare for writing front-end behavior on web-based applications.
This wasn't because JS was particularly awful to write code in. Internet Explorer, the king of browsers at the time, routinely exhibited totally unexpected behavior with little to no tools to discover how to fix things. While this may sound like a personal attack against Internet Explorer, it's the truth of the matter. Other browsers had quirks, but none were as important as the quirks discovered in the most popular browser at the time.
The things that you wanted to start doing to make your app "Web 2.0" like transitions, CSS animations, AJAX behavior, big DOM manipulations, and so on, were totally possible with JS. You just had to write a lot of it and pray to whoever you wanted when you went to test it in IE.
One of the big catalysts for getting something better than vanilla JS to play with wasn't just to make writing the code more pleasurable, it was to make it easier to GSD. Two camps came out in this regard. You had folks who were abstracting away the JS a lot more, creating more of their own syntax and language for everything; a framework built in JS. Then there were folks like jQuery who were creating what a lot of people considered a library, in that it felt like you were utilizing a lot of the same vanilla JS you knew and loved, but with some wrappers and helpers.
I mean, AJAX was a big and cool "aha" moment when you first saw it and played with it. But the first time you got to do things like:
* Identify an element without verbosity like document.getElementById()
* Attach an onclick to elements reliably and in a cross-browser safe way
* Change the color, replace some text, and fade in or shake or whatever was cool at the time in a single line of code that worked everywhere
... things like these were also very, very cool.
And because jQuery was well-documented, and didn't change the language and feeling of using a lot of JavaScript too tremendously, it was, and continues to be, an invaluable tool in so many belts. There are tons of good libraries built on top of jQuery that continue to evolve with standards and trends.
Overall it's stood the test of time well, and has saved countless hours of development time; two important qualities in great software.
- elliotec 11y agoI strongly believe that jQuery by itself is almost always easier to use than any JS framework or combo of libraries. The fact that these frameworks often are incompatible or at least look down upon jQuery is odd and dare I say disrespectful.
- gedy 11y agoI think what a lot of folks frown upon about "jQuery" (sometimes without realizing) is using the DOM as your data model. I.e. state is only stored in text, attributes, tags, etc. - and apps quickly turn to crap due to the complexities of back and forth data binding, etc. It's not really about jQuery, just that style of coding.
- elliotec 11y agoYeah for sure, I think it's mainly a lack of structure which has also been solved in various forms, none of which necessarily prevail.