Skip to content

Instantly share code, notes, and snippets.

@JeffreyWay
Created November 28, 2011 18:08
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JeffreyWay/1401353 to your computer and use it in GitHub Desktop.
Save JeffreyWay/1401353 to your computer and use it in GitHub Desktop.
Comment by David Mark:
"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?"
Hi there... and yes *most* jQuery users are designers with no need to learn programming (let alone cross-browser scripting). That's fine for them as they only need to make mock-ups, not production Websites.
"Roots"
Hi there, again. :)
"The JavaScript community wasn’t nearly as vibrant and passionate as it is today."
When, where?
"Let’s take a trip down memory lane; we’ll rewind the clock several years – pre jQuery days."
That's a pretty short trip.
"The JavaScript world was a very different scene back then."
Yes and the world as a very different world back then.
"The community wasn’t nearly as vibrant and passionate as it is today."
You mean every blogger on the planet wasn't blithering about how HTML/JS/jQuery was the "next wave"?. The pundits have said as much since at least 1997. Just more of them today. Yes, bloggers are ignorant about browser scripting as well.
"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."
Prototype, like jQuery was condemned by anyone with experience. It got popular because of Rails.
"At that time, JavaScript was a widely hated language."
By ignorant people, of course. Lot of hate out there, most fueled by ignorance.
"Sometimes, it’s easy to forget that there were times when developers refused to take the necessary time to …ya know… learn JavaScript!"
How could anyone forget that? Browse the Web in IE with it configured to alert script errors. That's proof enough that most JS developers *today* didn't take the time to... well, you know... and most seem incapable of testing anything.
"Instead, they’d simply copy and paste their way, hoping to keep from getting that nasty JavaScript stain on their pants."
Yes they do. They've been doing that since the turn of the century (remember Dynamic Drive?). Only difference is that scripts being arbitrarily included are much larger now and many of today's widely used browsers (think mobile) are even less tolerant to bloated, sluggish scripts.
"The DOM
What you mean is, “I hate the DOM API.”"
Yes, that's what they would mean if they weren't ignorant.
"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.”"
Glad you've come to terms with that.
"No one can be blamed for feeling that way."
Blamed? Who blames Web designers for their feelings? Of course, ignorance is nobody's fault but yours. Do some due diligence (and I don't mean reading apologist puff pieces like this one) on jQuery and your feelings will likely change.
"Especially back in those days, when even IE5 support was in effect, things could get a bit nasty."
Well, shame that jQuery (and most things like it) falls flat on their face in IE 5 (and virtually anything else that isn't "approved" for end-user use by the script's authors). Perhaps it "supported" it with browser sniffing back then. Regardless, they clearly didn't have the "answer". Only people who thought they did were marketers.
"Browser implementations of the DOM were the culprit; not the JavaScript language."
Yes. Yet for years, jQuery was known as an "alternative" to the JS language. It "fixed" the language somehow. Again, marketing.
"This is due to the fact that there really wasn’t any DOM specification."
What the hell are you talking about? The DOM specifications in use then predated jQuery by several years. They could have sat down at the turn of the century and learned all they ever wanted to know about (for example) DOM attributes and the properties that reflect them. But they were likely still in junior high with other things on their minds. The history was there; they just missed it.
"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."
No, other than MS, the browser vendors didn't just wing it. Yes, some implemented popular IE features.
"In fact, many folks, including myself, would go as far to say that, as a language, JavaScript is really quite beautiful."
I don't know about beautiful. I've heard it described as "sexy" too. :(
"jQuery
Around that time, jQuery entered the atmosphere, and began taking the development community by storm."
And about a year later, it burned up in spectacular fashion, which only seemed to intrigue the "development community" (e.g. designers) more. Yes, they were blissfully ignorant of what was going on inside that miserable script and proceeded to plaster the ashes all over the world. They thought their models were real.
Face it, Resig was in school when he designed that thing and made all of the same old turn of the century mistakes: browser sniffing, ill-advised attempts at "overloading" (often involving host objects!), monolithic design, etc. It was just another Prototype (for people who don't know JS and by people who don't know JS) and widely avoided by experienced developers, as well as beginners who took the time to do their homework.
And he demonstrated that he was unwilling to learn through his petulant responses to any and all criticism, including, but not limited to the browser sniffing and lack of foresight about the imminent mobile craze. Where's your cool library? And then... you are just jealous of my library? And then there was: we don't care about phones. As predicted, all of those pigeons came home to roost and they dealt with the problems in the confused, flailing manner of people who don't know what they are doing. Then there's: good enough for Google or whatever. All you have to do is look at the type of people I was doing this for to know it was a credible strategy. That's a Madoff quote. IIRC, he also used the "just jealous" spin that the jQuery PR stiffs are famous for. Frauds all talk alike. :(
Resig was/is a wildly overconfident neophyte (and quite irritating in his constant displays of ignorance).
"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)."
Here is where you really go off the tracks. jQuery is not easy to grasp. It can't be as the code inside changes constantly as its developers proceed on a long slow climb up the learning curve.
For example, ask any jQuery maven to explain what the "attr" method is supposed to do. Then ask the authors, consult the "documentation" and Google for "jQuery attr problems". Yet that method is called in virtually every blog post, book example, plug-in, etc. Get the picture? People are blissfully calling functions with no clear expectations and no reality-based documentation. That's ignorant for sure (and not programming at all). Cornford calls is "programming by mystical incantation". Having tried to help them fix that miserable, confused and confusing function for years, I can assure you it is nothing you want to call.
Remember what I said about the DOM specifications. They've been there all along and are quite comprehensive (perhaps too much so for beginners). In any case, they beat the hell out of reading the confused ramblings of the jQuery authors. They've been pushing and pulling on that "attr" code for years, occasionally updating the community on their "findings" when the answers have been in plain view since the turn of the century.
And having one magic object is no more confusing than having two or three (or even ten!). What are you saying there?
"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');"
That's a bad example.
addClass(document.getElementById('container'));
There are plenty of addClass renditions out there to copy. Nothing magic about jQuery's, except that it insists on returning the - this - object. Take it from me (as I do have a lot of experience with this stuff), chaining is not only inherent to the language, but usually bad for your debugging efforts. Nest; don't chain.
And you can easily write a one-liner wrapper for gEBI with a short (read: obscure) name. ;)
"Fun Fact: Technically, though jQuery popularized the idea of a CSS selector engine, it was largely based on work by Dean Edwards."
If only they had both kept their mouths shut. Queries are the worst possible way to go about browser scripting. A huge, complex function that parses CSS selector queries? Just use gEBI and gEBTN or... write wrappers for each that are specific to your needs. Using queries is not only slow and overly complicated, but also has been proven wildly unreliable. jQuery claims on its Website to be "CSS3 compliant" and that's pure fiction (yes, marketers lie).
But if you must use them, familiarize yourself with the query methods (Selectors API) that are now built into virtually every browser jQuery claims to "support". No, you can't use some of the newer selectors with IE 8, but then you shouldn't be using those anyway as they lead to brittle scripts that are tightly bound to complex DOM structures. Yes, it's fast for mock-ups... Aha! Might have cracked this case wide open.
See some examples of using the Selectors API (among other DOM features) here:-
http://jsperf.com/browse/david-mark
Look at the relative performance. Realize that arbitrarily including a huge, complicated mess like jQuery will alienate your mobile audience. I am so tired of simple documents that take minutes to load over 3G and then steal the scroll position to "navigate" to a script-added bookmark. Kind of like this one. :(
"And then, at some point, the timeline skewed into this alternate reality…"
No, reality caught up to the hype.
"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."
All complete, unadulterated bullshit. jQuery has tons of complex code that you don't need. And they are the worst at "normalizing" browser quirks, despite that being their primary mission. Hint: you don't need to "normalize all browsers" in most contexts. Just concentrate on writing your sites and apps. Yes, you'll run into differences in DOM implementations (less to worry about every year) and that's how you *learn*. In contrast, you can't learn anything from fumbling around with one version of jQuery after the next. They don't just hide quirks; often they compound the hell out of them until the cause-effect is impossible to determine.
"While jQuery’s community grew in leaps and bounds, the library, itself, also continued to mature and take shape. The world was peachy."
For designers to create interactive mock-ups. For developers, the jQuery marketers were just pushing snake-oil.
"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?"
Marty! The reality is that Web designers build the majority of Web sites and they don't know anything about cross-browser scripting. They freely admit that. As long as they are creating mock-ups and not production code, nobody should care. But if you aspire to be a programmer, criticism of jQuery is good for you (and not a reflection of you). What you don't want to do is play the victim. ;)
"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."
Madoff was really popular for decades. Took a long time for the fraud to be uncovered. Meanwhile many "experts" touted his "popularity" (while the fraud played the victim and squawked about perceived envy).
"Everyone has an opinion about the spotlight, it seems."
So it seems! :)
"For example, you’ve no doubt heard endless criticism of Catholicism. “They worship statues.”"
No, never heard that. BTW, what do you worship?
"Is that the only religious body with questionable history? Surely not; but it’s the largest."
Off the deep end now... What does religion have to do with programming? Granted, it has everything to do with jQuery.
"The United States is one of the most powerful countries in the world. Naturally, everyone has an opinion. “Americans are ignorant and fat.”"
As an American, I can confirm that many are. Stereotypes are usually rooted (however tenuously) in reality.
"Ignore the good, and spotlight the bad.jQuery is the most popular JavaScript library, by a landslide."
Is this an infomercial now? :(
"Again, everyone has an opinion."
Yes, for the third time. :)
"I’ve read countless criticisms – everything from what it doesn’t do, to the structure of the code base."
Ahem, you've left out the elephants in the room. What it doesn't do is irrelevant unless it is something that the marketers claim it does. They are known for that. And what does the "structure of the code base" even mean for something like jQuery. It's just a lousy (and I do mean lousy) script. Rearrange crap any way you want and it is still crap (see Dojo, Closure, YUI, Ext JS, etc.)
"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."
Mootools is garbage too. Comparing these things is an exercise in futility. Comparing their user bases even more so.
"While some consider this to be a downside, I honestly view it as a strength – in an odd way."
Odd indeed.
"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!"
No, though you didn't realize it, you just answered your own question. Most Websites are (for better or worse--usually worse) built by *designers*. They actually "write" the JS/CSS for the sites, despite lacking technical skills. So of course jQuery has greater mass appeal.
Personally, I tell the agencies to send pictures of what they want, not "working" mock-ups. Saves a lot of time and money as I'm just going to throw out their JS/CSS (and likely the HTML too) before I start readying the site or application for release. That way the clients know their sites won't be throwing exceptions at IE users, blowing up mobile browsers, etc.
"This is the argument you’ll hear more than any other. Again, a testament to jQuery, many people learn jQuery before vanilla JavaScript."
This is hardly a testament to jQuery.
"There have been countless debates on whether this is a good thing or not."
And it has long been decided (about four years ago) that it wasn't a good thing. Again, browse around the Web a bit, perhaps with exception alerts turned on... Then try it on a phone... Huge, disgraceful mess, right?
"In fact, these sorts of discussions extend to all abstractions."
Here we go...
"Should designers use CSS preprocessors and frameworks, like Sass and Compass, respectively, before learning the ins and outs of CSS?"
Irrelevant. End-users don't have to download those and the browsers don't have to parse and execute them.
"Is it okay for a Ruby developer to use CoffeeScript without first learning JavaScript?"
Good God, no! :(
"Should you use Modernizr before learning how to write a single feature test?"
A general purpose blob of feature tests couldn't be further from appropriate for browser scripting. A general purpose blob of JS anything usually indicates cargo cult programming (and a lot of bogged down end-users).
"Is it okay to use CodeIgniter if you’ve only just learned PHP?"
Server side. Users don't *download* that stuff. Big elephant there.
"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!"
It's far more scary with a creaky, confused abstraction on top of it. Again, you'll never learn anything and will run into problems that exist only because the jQuery authors are still trying to learn basic DOM scripting concepts (see attr/prop fiasco).
"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."
Couldn't be less relevant to the point (at least at this time). What on earth would a Web developer need with ES5 today? May never be relevant.
"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."
You are the one asking provocative questions here. Who said Web designers were bad people for using such a thing to create mock-ups? Now, adding jQuery for "a few effects" is bad (particularly today as scripted effects are largely unneeded). Putting something like that out for public consumption is certainly irresponsible.
"JavaScript and the DOM are scary!"
DRY. :)
"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."
You talk down to your audience like they are infants. jQuery is nothing like learning to count with your fingers. It's more like using an expensive, outdated and defective calculator. You learn absolutely nothing as you have no idea how it is screwing up inside.
"Though it’s a huge simplification of the issue, is jQuery not the same way?"
No!
"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."
Again with the patronizing. No, Web designers aren't going to learn to program, but if they can't deal with "objects and global variables", they sure as hell shouldn't be using jQuery for anything. (!)
"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."
You are simply off base. It is foolish to put blind faith in a script, particularly one with as bad a history as jQuery. Yes, lots of designers use it. No, that didn't/doesn't make it successful or useful as a teaching aid. Again, it incompetently attempts to hide browser "mistakes", often confusing the issues. You can't know this without experience and jQuery use does not gain you that sort of experience, popularity among designers/beginners notwithstanding.
"I view jQuery as bait."
Safe! :)
"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."
Lemon curry?
"jQuery Users Write Poor Code"
Getting closer to making a sound point...
"Once again, this is a massive generalization. Some of the biggest and most influential companies in the world use jQuery."
Uh, see the above Madoff quote. Save the bandwagon stuff.
"But yes, there are lots of beginners who are still in the process of learning."
Sort of the definition of "beginner", isn't it?
"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."
Oh, but programmers see most "advice and tips" as "unhelpful" scorn. They are an insecure lot. ;)
"We’re all learning."
If you are "learning" by using jQuery, you are just losing ground on the learning curve. You'll have to unlearn a ton of misinformation before you can rebound.
"Do we really need to attack some, because they have different priorities and skill-sets?"
Who is attacking who? The jQuery authors have proven incompetent, time and time again. That much is part of the public record. If I tell you to steer clear, or otherwise bring this fact to your attention, am I attacking you? Again, it's insecure programmers, acting on emotion, playing the victim, etc. It doesn't lead to anything good. Criticism of the *code* on the other hand, has led to at least some improvements in jQuery (has a pretty low ceiling though). Whining about such criticism just adds insult to injury.
"With popularity, comes the potential for bad advice."
Attaboy, home run! :)
"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."
What "hardcore Javascript developers"?! I think you got a bum steer there. Designers? Yes, indeed; quite passionate about the thing. It helps them get *their* job done fast, though it is often redundant effort.
"This passion subsequently lead to countless jQuery tutorials by community members – both good and bad."
Mostly bad. Very bad. Seemingly every JS neophyte on the planet has a jQuery-related blog with their cartoon visage at the top. They want in. ;)
"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."
Perhaps the potential for *more* bad advice. It's just a numbers thing.
"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?"
Personally, I couldn't care less how many people use any given script. Granted, if you don't know what you are doing, the presence of lots of noisy, misinformed users in the forums could be a considerable downside.
"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."
No real comparison there.
"Sure, some users have moved on to more comprehensive frameworks, like Dojo."
Moved on? Some users have made a huge freaking mistake; trading a little BS for a lot of it. Where have you been for the last few years?
"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."
That's the long way around by far. No badge.
"(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."
Stop listening to clueless people (looking right at you Rebecca Murphey). Yes, lots of seemingly intelligent, but wildly unqualified people blather on endlessly about things like jQuery and Dojo. Just walk away. Will be less to unlearn later. ;)
"Is that so bad?"
Yes!
"Real Deadlines"
If you are unqualified, using something like jQuery may give you the illusion of making a deadline. Again, it's for *mockups* and not appropriate for production use.
"It’s not like we’re coding in binary here, folks."
Javascript is a high-level scripting language. It's closer to writing batch files than assembly language.
"There will always be the advocates who suggest that you shouldn’t use a library – period."
Nope, those are loonies. But seriously, nobody ever advocated that. Point is you should reuse code that you know, not some pile of crap that some blogger told you about. The PR types have been using this line as a red herring for years (e.g. what's the point of writing *everything* from scratch?)
"Given the current state of JavaScript and the DOM, though, I honestly feel that this is bad advice – particularly for newcomers."
Interesting take. Of course, given the recent convergence of features in the major browsers, it's never been a better time to write your own "vanilla" JS functions? What state do you live in? :)
"They shouldn’t be expected to wrestle with frustrating browsers inconsistencies so early in the learning process."
If they are making mock-ups, who cares? If they are thinking of dumping those mock-ups on the Web and calling them "Web apps", they they best start learning. And again, the convergence. :)
"And, many times, abstractions are a very good thing!"
There are good abstractions and bad ones. jQuery is squarely in the latter category.
"It’s not like we’re coding in binary here, folks."
Whatever.
"When you use jQuery, or any other popular library, you’re benefiting from countless tests, bug fixes, and the best minds in the industry."
Good night. The countless tests, bug fixes, etc. haven't added up to much success have they? They are still flailing at twelve-year-old IE bugs. :(
And the best minds in the industry figured out a long time ago that monolithic, million monkey JS projects are poison. First three rules in this business are: context, context, context. How many of your fellow jQuery tenants have the same exact needs as you?
"Now, certainly, you’re not required to use somebody else’s framework."
Thank God for that. :) But seriously, that's often not the case. Come in on a project at the end and you could be stuck working with somebody else's fantasy code. Some learn; some get angry when you point out its shortcomings. But often there is no time to even discuss it.
"Create your own library, if you have the ability; that works too!"
Thank you.
"The goal is to:
Normalize browser quirks"
What business has that goal, other than businesses that produce monolithic JS libraries?
"Write less code"
Painful jQuery slogan. More like type less keystrokes, write more obscure code :(
"Benefit from as many minds as possible"
Hasn't worked out very well in browser scripting. Most of the minds pursuing these fools' errands belong to beginners. Experienced developers stay far away from such folly.
"Meet real deadlines, and get the job done"
Use fantasy code to meet real deadlines? You might want to run that one by management. ;)
"jQuery is not “a designer’s library,” but it appeals to designers."
If it walks like a duck...
"It’s not as class-based as other libraries,"
There are no classes in JS; but I get what you are trying to say.
"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."
...and blow up the Web. :(
"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?"
There's that bandwagon appeal again. Surely large companies can do no wrong by virtue of them being large companies.
You might want to think most of this through again. No crime in being ignorant, but it's irritating to see ignorance pawned off as enlightened opinion.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment