Brendan Eich Redesigns JavaScript to Look Like jQuery

April 1st, 2011 by Mike Wilcox


“Obviously, due to the success of jQuery and the lack of base-knowledge of JavaScript”, Brendan explained at a recent gathering, “JavaScript is a huge failure. I’ve redesigned it to look like jQuery, and will implement it, retroactively, into the web.”

When asked if by retroactively, he meant a change that would break non-jQuery websites, he replied: “Well yes, in theory. I wasn’t aware that there were any non-jQuery websites out there. Hell, even whitehouse.gov uses jQuery for crying out loud” (We’ve confirmed with the W3C and various browser vendors, that at midnight tonight, all browsers will switch from the JavaScript language to the jQuery language).

Mr. Eich responded to a question about the future of ECMAScript Harmony. “Are you kidding me? Nobody understands how instances inherit from a prototype… you think they will understand create? We’ve tried to educate developers for years on how scope works… there’s no way in hell I’m going through that again with let. And don’t even get me started on closures. Damn. Closures even make my head hurt! Did you ever see that article on Jibbering? That sum-bitch reads like science fiction.”

At the heart of his decision was the magic dollar. “I wasted so much time with all of these JavaScript methods, and I feel bad that I’ve made web developers type these long-ass names like getElementById and getElementsByTagName. And in particular attachEventListener! What was I thinking there? I could have just used on!”

“With jQuery, I can just wrap it in a dollar sign and it magically returns whatever I want. I’m not even sure how it knows! I once wrapped the entire page in a dollar sign… and it ajax-ified the whole thing. Incredible.”

While the fate of JavaScript libraries looks dim, Brendan was unfazed. “Pussy-libraries is what I call them.” he said, “They all try to look like jQuery anyway. They even try to copy the dollar sign. But only jQuery gives you true bling!” At this point, Mr. Eich seemed to go into a trance for several minutes with a strange smile on his face.

When Mr. Eich recovered he continued his slide show with examples on why jQuery is superior to JavaScript. “When I first created JavaScript, I thought it was important to have the language read vertically and keep horizontal scrolling to a minimum.”


var current;
var setSelected = function(node){
	current = node;
}
var doEvenHover = function(node){
	node.style.backgroundColor = "yellow";
	setSelected(node);
}
var doOddHover = function(node){
	node.style.backgroundColor = "yellow";
	setSelected(node);
}
var doEvenOut = function(node){
	node.style.backgroundColor = "white";
}
var doOddOut = function(node){
	node.style.backgroundColor = "white";
}
var nodes = document.getElementsByTagName("td");
for(var i=0; i < nodes.length; i++){
	if(Math.ceil(i/2) == 1/2){
		nodes[i].attachEventListener("mouseover", doEvenHover, false);
		nodes[i].attachEventListener("mouseout", doEvenOut, false);
	}else{
		nodes[i].attachEventListener("mouseover", doEvenHover, false);
		nodes[i].attachEventListener("mouseout", doEvenOut, false);
	}
}

Taken from Brendan's Slideshow "Gimme More jQuery, Man", slide 27

"As you can see by slide 27, the effort needed for the simple act of making odd and even rows in a table change colors when you hover over them is just incredibly complex. When I designed the language I never expected that it would be used so... creatively. I mean... I would expect people to use CSS. The following slide shows that with jQuery, it just makes so much sense."


$(document).getTDs().getEven().hover().css("yellow").addCustomEvent("setSelected").setSelected(this.currentMagicNode).get.out("white").getTDs().getOdd().hover().css("yellow").addCustomEvent("setSelected").setSelected(this.currentMagicNode).out("white");

"Gimme More jQuery, Man", slide 28

"In hindsight I can see why JavaScript never caught on", said Brendan. "All of those semi-colons and line breaks makes the code very difficult to read. And you read code horizontally, not vertically — DUHHHH! JavaScript is NOT winning!"

"And that prototype thing, I don't know how I dreamed that crap up", he continued, "I thought it would be an easier way to create objects even though everybody kept telling me BTNJ! (but that's not Java), and I just figured that Java was a fad. I don't know who the jerk-wad was who renamed LiveScript to JavaScript. Lucky bastard. I mean — how did Java get so successful? Has anybody looked at that ****"

Brendan apologized for his outburst of profanity and continued: "I had thought that the way global variables worked was a mistake. But as it usually does, jQuery took this mistake and made gold. Everything is a global in jQuery. It doesn't mess your head up with namespaces and binding functions to objects and all that jazz. It's like it's all one big function. Brilliant."

"In the beginning I expected that everyone would just write their own code. But this open-web thing-a-ma-bob... everybody started stealing everybody else's code! I don't know about you, but I wasn't taught that in school. The brilliance about jQuery is instead of fighting all this code stealing, they just call it plugins. I've even started blog posts that list my favorites. I have 20 jQuery Lightboxes and 15 jQuery Carousels, and 10 jQuery Grids... oh, and my favorite: 50 of My Favorite Plugins. I really like plugins. I once made an app with 32 plugins. Of course, all those plugins then loaded about 250 resources into my page and slowed it down so much that Firefox popped up that stupid Slow Script Warning, but after a few minutes the page loaded, and the user experience was just... sooooo intense!".

I also like jQuery because it requires fewer characters to type it, said Brendan. Not the code, I mean the word — jQuery is six letters and JavaScript is ten. I think that explains it all right there.

UPDATE: The latest report shows that the eight developers who are NOT using jQuery are busy updating their code now.

Tags: , , , , ,

6 Responses to “Brendan Eich Redesigns JavaScript to Look Like jQuery”

  1. paraboul says:

    The overflowed [code] tag is pure genious.

  2. Larry Battle says:

    jQuery has always been the only cure for Javascript’s disease. Why write 15 lines when you can do it in 1.

    Did you know that invalid variables names cause a buffer overflow in Javascript?
    I wrote it about here. Is document.cookie safe?. The answer is no and I explain why.

  3. Adolf Eichmann says:

    Oh, God! THANK you! Now I won’t have to include “-jquery” in every Google search in order to filter out all the crap. ^o^

  4. Awesome article! Very well done.

  5. Totti says:

    This is a nice April Fool joke :D.

  6. Serge says:

    It is ingenious, Mike. Everything can be done with just one line of code, dreams come true. And some people keep saying Jquery is somehow limited :)