smalpierre
New member
If you get into things like dynamic menus, AJAX, and practically anything else JavaScript related, you've heard of jQuery. Oh it's so great, it does everything for you! Oh, it makes AJAX easy! It's the best thing EVAR!!! You don't even have to download it, just load it from CDN!!
Yeah yeah - I've heard all this nonsensical garbage before. Here's why I think it's terrible.
1. You learn the "jQuery way" which honestly the function chaining while cool in a way - in practice is clunky. You're piping one function into another into another into another ad nauseum. This makes the code less readable.
2. If you do chose to download it, and want to actually see the source, it's not a small tiny lightweight piece of code. Even minified / gzipped it's not tiny.
3. It's one more dependency that's unnecessary. AJAX in vanilla js isn't that difficult, and it certainly doesn't require 30k of code to download to the browser. My AJAX library is something like 80 lines of commented code, nowhere NEAR 30k.
4. It doesn't really make things easy, it makes most things even more difficult in many cases - and it's not as flexible as just directly using the language. It just gets in the way. It doesn't do everything for you, and often times it takes MORE jQuery code than if you just did it in JS directly.
5. People and their jQuery examples online ... it's hard to find useful examples in plain old JavaScript anymore. The search engines are LOADED with jQuery examples, examples specific to doing things in sitepoint, or portlets, and even THOSE are usually jQuery instead of JavaScript.
6. CDN sucks. What happens if their site goes down? What happens if they decide to change something? Not saying that they WILL, but you don't have control over your codebase at that point, and that is a BIG no-no in my book. I guess it's fine for prototyping, but you should download the code, and serve it from your server for production sites.
In short - no matter how shiny it looks on the outside, and how much it can do - you're probably not going to use 99% of it's functionality anyway. You're better off writing your own simple libraries to do what you want, how you want.
There is a time and a place for libraries, but abstracting away the entire base language is crazy, and that's what it tries to do. If you're going to use jQuery UI elements and ONLY jQuery UI elements, by all means use it! But beware - there is going to be SOMETHING you don't like, or it doesn't do. In most cases you're better off building one element at a time, using best practices in the base language. It'll be faster, lighter, more flexible, and FAR easier to read the code.
Yeah yeah - I've heard all this nonsensical garbage before. Here's why I think it's terrible.
1. You learn the "jQuery way" which honestly the function chaining while cool in a way - in practice is clunky. You're piping one function into another into another into another ad nauseum. This makes the code less readable.
2. If you do chose to download it, and want to actually see the source, it's not a small tiny lightweight piece of code. Even minified / gzipped it's not tiny.
3. It's one more dependency that's unnecessary. AJAX in vanilla js isn't that difficult, and it certainly doesn't require 30k of code to download to the browser. My AJAX library is something like 80 lines of commented code, nowhere NEAR 30k.
4. It doesn't really make things easy, it makes most things even more difficult in many cases - and it's not as flexible as just directly using the language. It just gets in the way. It doesn't do everything for you, and often times it takes MORE jQuery code than if you just did it in JS directly.
5. People and their jQuery examples online ... it's hard to find useful examples in plain old JavaScript anymore. The search engines are LOADED with jQuery examples, examples specific to doing things in sitepoint, or portlets, and even THOSE are usually jQuery instead of JavaScript.
6. CDN sucks. What happens if their site goes down? What happens if they decide to change something? Not saying that they WILL, but you don't have control over your codebase at that point, and that is a BIG no-no in my book. I guess it's fine for prototyping, but you should download the code, and serve it from your server for production sites.
In short - no matter how shiny it looks on the outside, and how much it can do - you're probably not going to use 99% of it's functionality anyway. You're better off writing your own simple libraries to do what you want, how you want.
There is a time and a place for libraries, but abstracting away the entire base language is crazy, and that's what it tries to do. If you're going to use jQuery UI elements and ONLY jQuery UI elements, by all means use it! But beware - there is going to be SOMETHING you don't like, or it doesn't do. In most cases you're better off building one element at a time, using best practices in the base language. It'll be faster, lighter, more flexible, and FAR easier to read the code.