We should get this out into the open. There seems to be a commonly held belief that jQuery users are ignorant, and, more often than not, designers. Where did this come from, and is it true?
Roots
The JavaScript community wasn't nearly as vibrant and passionate as it is today.
Let's take a trip down memory lane; we'll rewind the clock several years - pre jQuery days. The JavaScript world was a very different scene back then. The community wasn't nearly as vibrant and passionate as it is today. Sure, back then, there were a few libraries, like Prototype; but they never managed to grab the regular user spotlight the way that jQuery soon would. At that time, JavaScript was a widely hated language. Sometimes, it's easy to forget that there were times when developers refused to take the necessary time to ...ya know... learn JavaScript! Instead, they'd simply copy and paste their way, hoping to keep from getting that nasty JavaScript stain on their pants.
The DOM
What you mean is, "I hate the DOM API."
What these copy and paste addicts (I was one of them) didn't realize is that, when you say, "I hate JavaScript," what you really mean (whether you realize it or not) is, "I hate the DOM API." No one can be blamed for feeling that way. Especially back in those days, when even IE5 support was in effect, things could get a bit nasty. Browser implementations of the DOM were the culprit; not the JavaScript language. This is due to the fact that there really wasn't any DOM specification. As a result, browsers sort of winged it as best as they could! We have innerHTML
not because of a specification, but because the Internet Explorer team decided to just throw it in there (at which point the other browser vendors reverse engineered it, and implemented it into their own browsers). But the JavaScript language, as a whole, is solid.
In fact, many folks, including myself, would go as far to say that, as a language, JavaScript is really quite beautiful.
jQuery
Around that time, jQuery entered the atmosphere, and began taking the development community by storm. While other libraries like Prototype still retained a certain level of complexity and confusion for newcomers, jQuery was ridiculously easy to grasp, thanks to the fact that everything is accessible, via the jQuery
object (something that it's, ironically, often criticized for).
Need to apply a class? Easy; doing so is tailor made for designers. jQuery allows you to use the CSS selectors you already know to query the DOM.
$('#container').addClass('ahh-yeah');
Fun Fact: Technically, though jQuery popularized the idea of a CSS selector engine, it was largely based on work by Dean Edwards.
And then, at some point, the timeline skewed into this alternate reality...
It literally couldn't be simpler. By abstracting away complex code and browser quirks, developers could get back to doing what was important: creating websites and applications.
While jQuery's community grew in leaps and bounds, the library, itself, also continued to mature and take shape. The world was peachy.
And then, at some point, the timeline skewed into this alternate reality (okay, not as Doc Brown as that), where, suddenly, if you labeled yourself as a proud jQuery user, certain members of the JavaScript community would consequently feel the need to stereotype you as an ignorant "designer" (regardless of whether you were or not) - certainly not a "JavaScript Developer." How did this happen? JavaScript developers don't use jQuery?
The Burden of Popularity
Everyone has an opinion about the spotlight.
It's only natural that, once you reach a certain - for lack of better words - popularity, you open yourself to incredible amounts of scrutiny. Everyone has an opinion about the spotlight, it seems. For example, you've no doubt heard endless criticism of Catholicism. "They worship statues." Is that the only religious body with questionable history? Surely not; but it's the largest. The United States is one of the most powerful countries in the world. Naturally, everyone has an opinion. "Americans are ignorant and fat." Ignore the good, and spotlight the bad.
jQuery is the most popular JavaScript library, by a landslide. Again, everyone has an opinion. I've read countless criticisms - everything from what it doesn't do, to the structure of the code base. However, perhaps the biggest criticism of jQuery comes from a simple truth: its users, as an average, are less experienced with vanilla JavaScript, when compared to, say, Mootools. While some consider this to be a downside, I honestly view it as a strength - in an odd way.
The fact that jQuery has many less-experienced users is not its downfall; it's a testament to its appeal.
jQuery Users Don't Know JavaScript!
This is the argument you'll hear more than any other. Again, a testament to jQuery, many people learn jQuery before vanilla JavaScript. There have been countless debates on whether this is a good thing or not. In fact, these sorts of discussions extend to all abstractions.
- Should designers use CSS preprocessors and frameworks, like Sass and Compass, respectively, before learning the ins and outs of CSS?
- Is it okay for a Ruby developer to use CoffeeScript without first learning JavaScript?
- Should you use Modernizr before learning how to write a single feature test?
- Is it okay to use CodeIgniter if you've only just learned PHP?
Personally, I feel that those who demand that newcomers first learn JavaScript before moving on to jQuery are missing one thing: JavaScript and the DOM are scary! If you throw the ES5 specification at them, they're going to have a heart attack, unless they have a real interest in becoming a JavaScript developer. Many people simply need to add a few effects to their websites. We can't always master everything. Are they bad people for choosing their priorities? Of course not.
JavaScript and the DOM are scary!
Compare this to simple Math. When you first learned how to add 2 + 2
, did you do it the official way? I sure didn't; I used my fingers. I bet you did too. Though it's a huge simplification of the issue, is jQuery not the same way? It provides new JavaScript users with a simple and exciting entry point. Do you honestly expect them to learn about closures and objects and global variables before they even learn how to do something fun? Come, come, now.
The strict, "Learn it the right way, or you're a fool" viewpoint is naive, and doesn't take into account the various learning styles that we all have.
I view jQuery as bait. Hold it over the user's head, get them really excited by it, and then, when they feel ready, they almost always move on to learning more vanilla JavaScript.
jQuery Users Write Poor Code
Once again, this is a massive generalization. Some of the biggest and most influential companies in the world use jQuery. But yes, there are lots of beginners who are still in the process of learning. Oh well; it happens. Poor code exists in every language. I've written a good bit of it myself, I'm proud to say! The best we can do is, rather than scorn them publicly, offer advice and tips when we can. We're all learning. Do we really need to attack some, because they have different priorities and skill-sets?
With popularity, comes the potential for bad advice.
jQuery managed to generate this incredibly passionate community - from the hardcore JavaScript developers down to the designers who were amazed by how easy it was to get the job done. This passion subsequently lead to countless jQuery tutorials by community members - both good and bad. While still learning jQuery (something I'm still doing), I can guarantee that I offered some terrible advice at one point or another. It's not too dissimilar to the PHP community. With popularity, comes the potential for bad advice.
The Ruby Community
This sort of pointless teaching almost hurts the community.
In the Ruby community, there's an interesting dynamic. Tutorials are, to generalize things, written by the veterans. In other words, if you're going to write a Ruby on Rails article or book, you should fully expect extreme scrutiny. If you don't have a massive level of experience, don't you dare write about it. In some ways, this is a strength. As a student, you can more easily rest assured that what you're learning is correct. On the other hand, PHP tutorials are all over the place. Writers sometimes focus on the insignificant, and ignore the important. You'll often find best practice PHP tutorials, which describe whether or not it's faster to use single quotes or double quotes. Of course, this sort of pointless teaching almost hurts the community.
What Do You Prefer?
It's an interesting thing, I must say. What do you prefer? A smaller, passionate base, or an incredibly popular one, consisting of all skill levels? There's certainly pros and cons to each.
It's undeniable that many of us feel a need to be trail blazers. Remember when parents began signing up for Facebook? Critics widely declared that the end of Facebook was near. Once you sacrifice exclusivity for wide appeal, people instinctively begin searching for the next thing. But that didn't happen. The same is true for jQuery. Sure, some users have moved on to more comprehensive frameworks, like Dojo. But that's to be expected, and should be a badge of honor for jQuery. For many, the learning cycle goes like this:
- Learn jQuery; get excited.
- Realize that you have no clue what
this
refers to in different situations. Learn JavaScript, and incrementally improve your old jQuery code. - (Optional) Advance your skills to the point where you need a more comprehensive framework for building large applications. Begin reviewing additional tools, such as Dojo.
Is that so bad?
Real Deadlines
It's not like we're coding in binary here, folks.
There will always be the advocates who suggest that you shouldn't use a library - period. Given the current state of JavaScript and the DOM, though, I honestly feel that this is bad advice - particularly for newcomers. They shouldn't be expected to wrestle with frustrating browsers inconsistencies so early in the learning process. And, many times, abstractions are a very good thing! It's not like we're coding in binary here, folks. When you use jQuery, or any other popular library, you're benefiting from countless tests, bug fixes, and the best minds in the industry.
Now, certainly, you're not required to use somebody else's framework. Create your own library, if you have the ability; that works too! The goal is to:
- Normalize browser quirks
- Write less code
- Benefit from as many minds as possible
- Meet real deadlines, and get the job done
jQuery is not "a designer's library," but it appeals to designers. It's not as class-based as other libraries, but this makes the entry point for newcomers far more painless. So what we end up with is a library that helped reignite the JavaScript community. It's simple enough to appeal to first-timers, and powerful enough to be used by the largest companies in the world. Why exactly is it being criticized again?
Comments