May 27, 2008
jQuery and Javascript
Timeless Tools
It was only a few years ago that javascript was something a web developer could easily ignore. After all, it was useful primarily for popup ads, scrolling marquees, and other stupid tricks. But then something changed. Companies like Google started using Javascript in ways that made us take another look. Google Maps and GMail (among others) opened our eyes. Javascript was being used to bridge the gap between desktop applications and web applications. People started to throw around the term web 2.0.
Today, knowing javascript is one of the most valuable skills that a web developer can have. The modern web thrives on javascript. When properly applied, it makes our sites easier to use, faster to interact with, and nicer to look at. Javascript makes platform independent, web-based desktop applications, a reality (much to Microsoft’s chagrin).
The Need for jQuery
Unfortunately, javascript can be really cumbersome to a web developer, especially when accounting for differences in web browsers. To really know javascript, you had to be an expert on some very technical browser details and differences, including the frustrating things that changed from version to version. Internet Explorer lost a few more points. Javascript wasn’t particularly fun to use either, requiring some rather wordy code to do simple things. Many web developers, including myself, decided that this was a waste of time. If we absolutely had to use Javascript, then we’d copy and paste our way around it. There had to be a better way.
Rise of the Frameworks
A few highly skilled and enterprising javascript developers came up with a solution to this mess: javascript frameworks. Frameworks like Prototype, YUI and Dojo sat on top of javascript and took care of the browser-specific bugs, issues, and details. They also took out a lot of the wordy function calls and grunt work involved with traditional javascript. Suddenly you could start to work with and enjoy javascript, without being a full-time javascript developer. And that started the creativity flowing.
The previously mentioned frameworks are fantastic, but they still were pretty technical, and likely most appreciated by those that were already spending a lot of time with javascript. That is to say, the appeal was more to javascript developers than web developers. That’s my opinion anyway.
Enter jQuery
But then a new framework called jQuery came along that changed the way we thought about frameworks, much in the same way that frameworks changed the way we thought about javascript. If you knew your way around XHTML and CSS, then you could start using jQuery almost immediately. And you didn’t have to already know javascript in order to use it.
jQuery’s syntax is mostly unambiguous and just makes sense. It presents a relatively simple interface to the extraordinary power of javascript, while taking care of the nitty gritty details for you. It brings an element of fun to something that was previously void of it. While you still need to reference the documentation regularly, it’s largely based on examples that provide quick answers without redirecting your attention.
This praise for simplicity is not to say that jQuery is just that. In fact, jQuery has it’s share of complexity just like all of the frameworks do. But you don’t have to open the hood on that complexity just to start the engine and drive. jQuery gives you a lot of horsepower even if you never intend on learning how to change the oil. But once you start using jQuery, it’s not uncommon to develop an interest and learn more. jQuery’s toolset is one that’s easy to grow with, and equally satisfying to the expert as it is to the novice.
jQuery’s syntax and ease of use sets the standard for javascript frameworks. If you’ve held off on using javascript for any particular reason, then jQuery is likely to make you question those reasons. jQuery is a timeless tool because it’s a game changer in this industry. If we’re not using it 5 years from now, then I’m certain we’ll at least be using something largely inspired by it. There’s little doubt that jQuery’s influence will go beyond javascript, inspiring the APIs of other applications and tools from here on out.
