Simon Willison’s Weblog

Subscribe

Why is learning JavaScript better than just learning jQuery?

1st July 2012

My answer to Why is learning JavaScript better than just learning jQuery? on Quora

jQuery is a JavaScript library. When you write code using jQuery you are programming in JavaScript. This line:

jQuery(“#foo”).hide()

Is calling a JavaScript function called jQuery, passing it the string “#foo”, then calling the JavaScript method called hide on the object that was returned from the jQuery function.

To write good, performant, maintainable jQuery you need to understand this—hence why some companies specify JavaScript as the particular skill they require. There are a surprisingly large number of client-side programmers out there who only know how to use jQuery and don’t actually understand how it works. The law of leaky abstractions demonstrates that they will be completely unprepared to deal with the inevitable bugs and challenges that they will eventually run in to: http://www.joelonsoftware.com/ar...