Is It a Good Idea to Learn JavaScript Before Learning Jquery

Is it a good idea to learn JavaScript before learning jQuery?

An emphatic YES. It won't take as long to learn as you fear and the rewards will be more than worth it.

Is it necessary to learn JavaScript before learning jQuery?

  1. Part of being a good programmer is having an interest in understanding how things work. You can't understand how JQuery works without knowing JavaScript.

  2. A good programmer has a diversity of skills. Knowing both the JQuery way to do things and the JavaScript-only way makes you more versatile.

  3. Most employers who are looking for someone who knows JQuery are probably also looking for someone who knows ordinary JavaScript.

  4. You can never achieve true expertise in JQuery without understanding JavaScript.

  5. Sometimes even a fairly lightweight framework is more than you need.

  6. If you don't ever learn to do things the hard way, you won't appreciate what's so great about doing it the easy way.

  7. Moreover, if you start by learning to do things the easier way, you'll have that much harder a time motivating yourself to learn to do it the hard way.

  8. Learning the language first without the fancy frameworks builds character.

  9. Who knows, maybe you'll want to make your own framework someday. Or even work on a new version of JQuery. To do that, you'll need to know the language.

I've learned jQuery, should I go back and learn proper javascript?

No.

The move to frameworks is driven by years of frustration over the browser-dependencies and sheer dislike for many of the original decisions made in the design of Javascript. Note that you are still working in Javascript though so it isn't really fair to say "learn Javascript" so much as "explore the areas of Javascript now handled by JQuery."

With respect to your attractiveness to a prospective employer, I'm pretty certain that JQuery would be a better skill to list on a resume than Javascript (I know it would in our shop). If you think about it, employers who care enough to do good client-side development will expect prospective employees to have experience with tools like JQuery. Those who don't care as much about client-side development simply won't make client-side skills - including Javascript - a priority. Indeed, if you are going to spend your time learning more about the client side, I'd recommend learning another client-side framework (e.g. YUI or Ext). Not only will it make you more valuable, it will almost certainly require a certain degree of exposure to more of Javascript's idioms due to differences in the frameworks.

Update - Rohan makes a good point about learning Javascript: that it may help you code more efficiently and effectively in JQuery. I agree in the abstract but I would personally be a bit hesitant to put too much effort in this area. As a long (long) time developer, I've learned to be very focused on the payoff from investments of time and effort. There is much to learn in the world, and only so much time to learn it. The time I spent learning how to write ISAPI dlls, for example, has paid very little compared to the investment.

Update 2 - A few people are making the argument that JQuery is slower than raw Javascript. Is anything ever new? This same argument about "raw" development versus frameworks has been going on for decades!

In this case it is especially perplexing, though. In my experience, people who adopt a client-side framework actually end up delivering client-side functionality. Those that don't tend to get locked into server-side solutions because of the inherent difficulty of handling DOM incompatibilities across browsers, Javascript idiosyncrasies, etc. Thus, recommending Javascript "for speed" misses the whole dynamic where a pure Javascript site is very likely to be slower because developers end up falling back on Server-side code just to stay productive.

Do I need to learn Javascript before AJAX or does AJAX not require Javascript knowledge?

First, learn the basics of JavaScript. It's a programming language, not a markup language. You don't need to become an expert immediately, but learn the basics — what it is, the basic structures (functions, control flow statements, variables, objects, etc.), that sort of thing.

Ajax is a technique for retrieving data in a web page without refreshing the full content of the page (or indeed, any of it if you don't want to). You perform Ajax operations (sending a request, interpreting the response) using JavaScript and some other things, such as the XMLHttpRequest object. Ajax isn't a part of JavaScript. They're just used together in the web environment.


(Side note: Although Ajax stands for "Asynchronous JavaScript and XML", the XML part of that is optional; you can do "Ajax" without using XML and in fact, many if not most people do. Ajax lets you send and retrieve all kinds of data, including XML but also including HTML, JSON, plain text, and lots of other stuff.)


Some references that may be useful:

  • JavaScript:
    • The Mozilla JavaScript pages
    • JavaScript: The Definitive Guide by David Flanagan (yes, an old-fashioned paper book)
    • Crockford's articles on JavaScript (a bit advanced, wait 'till you're ready). Crockford is smart and knowledgeable, but not everyone agrees with all of his conclusions. (I don't.) But it's good to read and understand his points, and make your own decisions. He's mostly right, most of the time.
    • My own anemic little blog (start with the oldest entries and work forward)
    • The ECMAScript specification (PDF | handy HTML version)
  • The DOM
    • DOM2 Core
    • DOM2 HTML
    • DOM3 Core
    • HTML5 Web Application APIs
  • (Speaking of which) The HTML5 specification. Parts of it are just codifying what web browsers actually do right now; other parts of it specify new stuff. Mostly you can tell which is which by checking whether the thing in question is part of HTML4. If it is, then likely the HTML5 spec tells you what browsers mostly do today. If it isn't, then it's new and browser support may be perfect, or may be non-existant. :-)
  • The API docs for the library you choose. There are several good ones: jQuery, Prototype, YUI, Closure, or any of several others. (jQuery is the most widely-used at present.)

Can I be an expert on jQuery without knowing a lot about Javascript?

JQuery provides a framework that allows you to create a lot of great features relatively simply but it's still javascript and doesn't release you from the need to have at least a reasonable understanding of javascript to use it.

Javascript is one of those misunderstood languages because it's a scripting language, it's a very powerful and flexible language... learn it and you'll be grateful you did.

Where can I learn jQuery? Is it worth it?

Rick Strahl and Matt Berseth's blogs both tipped me into jQuery and man am I glad they did. jQuery completely changes a) your client programming perspective, b) the grief it causes it you, and c) how much fun it can be!

http://www.west-wind.com/weblog/

http://mattberseth.com/

I used the book jQuery in Action
http://www.amazon.com/jQuery-Action-Bear-Bibeault/dp/1933988355/ref=sr_1_1?ie=UTF8&s=books&qid=1219716122&sr=1-1 (I bought it used at Amazon for about $22). It has been a big help into bootstrapping me into jQuery. The documentation at jquery.com are also very helpful.

A place where jQuery falls a little flat is with its UI components. Those don't seem to be quite ready for primetime just yet.

It could be that Prototype or MooTools or ExtJS are as good as jQuery. But for me, jQuery seems to have a little more momentum behind it right now and that counts for something for me.

Check jQuery out. It is very cool!



Related Topics



Leave a reply



Submit