Crossroads The ACM Magazine for Students

Sign In

Association for Computing Machinery

Magazine: Features Profile John Resig
Origins of the JavaScript ninja

Profile John Resig
Origins of the JavaScript ninja

By ,

Full text also available in the ACM Digital Library as PDF | HTML | Digital Edition

Tags: General programming languages

back to top 

You shouldn't develop anything that doesn't scratch your own itch," John Resig, the creator of the jQuery library, reflects. jQuery has clearly scratched John Resig's itch, and those of a few others, including Google, Amazon, IBM, Microsoft, Twitter, and Mozilla.

Resig created jQuery in 2006 to make his own web development easier. Since then, the open-source JavaScript library has spiraled into one of the most popular web front-end resource in use today. It's fast, simple, extensible, and provides a conceptually consistent wrapper around the spaghetti of mutually incompatible APIs that constitute today's JavaScript programming environment.

Resig's itch that led to jQuery began while he was a student at Rochester Institute of Technology (RIT). "It was incredibly frustrating to try and build a front-end application that would just work," he says. He began making life easier for himself by writing two independent pieces of software: a CSS class selector and an animation library. Those two projects meged together to become the first release of jQuery. Resig then turned his attention to cross-browser compatibility, and the project flew onward and upward from there.

Most programming systems get to the point that they satisfy the original author and subsequently stop evolving. Not so with jQuery. jQuery has succeeded directly because it has embraced its community. Resig explains, "The best way to do well is to listen. To communicate. To understand what it is that people need, and be more than willing to adapt."

jQuery's second major conceptual growth phase was when John ceased being its only user group. "I've made a number of changes in jQuery over the years that at first I didn't agree with. But I sat down and talked to the people making the suggestions, and eventually understood where they were coming from. That's way harder than any code you'd write."

This is Resig's uncomfortable truth of a successful programming system: success soon becomes more about non-code than about code. "The documentation, the community, the communication is effectively what it boils down to." Resig got this situation right early on, surrounding himself with people that, as he puts it, were much better at these things than he was. Even today, only around four of the 20 people on the jQuery team work on the core codebase. Rather than focusing on making jQuery bigger, the team makes it better.

The creator of jQuery talks about research, open source development and creating the most popular JavaScript library in use today.

"You want to solve everyone's problem, but you have to hold back. If you overextend yourself, it becomes way too challenging to maintain what you have," he says. "Unfortunately, one thing that we've learned is that any time you add features, you also add bugs and documentation."

Resig attributes much of his success to values he absorbed in his undergraduate dorm at RIT. He participated in a weekly R&D club, where members of the dorm would showcase projects they had been working on in the past week. This club led to some standard hallmarks of undergraduate hacker culture, like a networked soda machine (because, really, who hasn't wanted to script a soda machine?).

"That's what got me interested in open source," Resig says, "that crazy feeling of building things, iterating, being open. It was incredibly helpful."

Undergraduate research in a datamining group was another memorable experience. "It made computer science seem like a real, live, interesting field." Classes were rewarding in their way, but solving hard problems made the experience much more visceral.

Like many figures in programming languages and libraries, Resig doesn't have, or feel the need for, an advanced degree. His unofficial title is "JavaScript ninja."

In many ways, open source development has been Resig's laboratory. "More than anything else, it's a matter of becoming involved and actually looking beyond your own private projects. I don't think people realize how much of an accelerating force open-source development can be," he says.

"In college, there were so many smart developers, but then they'd get a job with the government or in the private sector and just be tweaking equations all day. School is fantastic and you get a great education, but at the same time, you have to go out of your way to extend yourself to get your code out there," Resign says.

Though jQuery itself is unlikely to appear at an academic conference anytime soon, its creator believes that the time has never been better to take on research in the browser. Universities have been instrumental at speeding up JavaScript engines. He also points to novel browser security models like process isolation as another outgrowth of browser research.

In practice browsers are dragged down by legacy APIs and the need to render old web pages. He points out that some researchers at Microsoft were able to construct a completely secure browsing environment, but only by stripping out some features that caused old web pages to break.

"That's the reality we live with," Resig says. His challenge: "There are two completely open-source browsers right now—Firefox and Chrome—that are open from top to bottom. If I were in college and doing research, I'd be doing that. Just develop your theorem. Go in and make C++ changes, and you're good to go!"

back to top  Footnotes

DOI: http://doi.acm.org/10.1145/1836543.1836557

back to top  Sidebar: John Query: Additional Q&A With the jQuery Creator

XRDS: jQuery both makes JavaScript faster and more straightforward to write. Are those two ever in contention?

John Resig: API design has come up a lot. At the time I built jQuery, I was primarily coding in Perl, and Perl is all about brevity. When I was working on the initial jQuery API, I focused a lot of brevity, what was the syntactically shortest way to bind an event, for example. As a result, a brief API arose that was also incidentally usable.

When I talk with other people about API design, many designers worry more about clarity than usability. They tend to confuse those points—if I make it very clear what this is going to do, it's going to be usable. But then you end up with Java-style APIs, factories and factory builders, and worse. I find brevity and simplicity so much more attractive. Developers enjoy it more.

XRDS: JavaScript is (in)famous for its hybrid functional and imperative natures. What's your take on this programming chimera?

JR: I think it's great. I hugely enjoy functional programming and the functional aspects of JavaScript. I don't think any serious JavaScript programmer out there is not using the functional aspects of JavaScript.

The thing that makes JavaScript really great is that it doesn't have its head in the functional sand, so to speak. Look at languages like Haskell. Obviously, you can code with it, but it's a completely different world from JavaScript and the functional programming provided there. I'm especially a fan of the bizarre prototypal inheritance that you see in JavaScript. It's really bizarre when compared to classical style inheritance, but in the end, it works.

XRDS: What's next for JavaScript?

JR: At least as a language, JavaScript has a huge future. I have a hard time seeing a future in which JavaScript is not still relevant. JavaScript is on the vast majority of all web sites. Considering how hard it is to just upgrade the JavaScript language (phenomenally hard), I can't see a world in which we are able to transition out of using it. Since JavaScript is used on virtually every web site, it's going to be around forever. Whether we like it or not at this point, we have the hand we've been dealt.

back to top 

©2010 ACM  1528-4972/10/0900  $10.00

Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. To copy otherwise, to republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee.

The Digital Library is published by the Association for Computing Machinery. Copyright © 2010 ACM, Inc.


There are no comments at this time.


To comment you must create or log in with your ACM account.


ACM Transactions on Programming Languages and Systems (TOPLAS)

The purpose of TOPLAS is to present research results on all aspects of the design, definition, implementation, and use of programming languages and programming systems

ACM Transactions on Software Engineering and Methodology (TOSEM)

Designing and building a large, complex software system is a tremendous challenge. TOSEM publishes papers on all aspects of that challenge

Communications of the ACM

ACM's flagship magazine, Communications of the ACM, is the premier chronicler of computing technologies, covering the latest discoveries, innovations, and research that inspire and influence the field

Journal of the ACM (JACM)

JACM aims to provide coverage of the most significant work going on in computer science, broadly construed