permalink

12

Book Corner: A Review Of Smashing jQuery

Hey guys. Today I wanted to share my review of Jake Rutter’s new book, Smashing jQuery

Jake was one of the authors that kindly sent me a copy of their book last week and I wanted to post my thoughts on it in case it helped anyone looking for a title to read at the moment.

Smashing jQuery offers an exploration of jQuery fundamentals, covering basic concepts like understanding the Document Object Model (DOM), selectors, ajax, plugin authoring and more. 

The book is very much targeted at those who are new to jQuery, but manages to go a step further than some of the other beginner titles by providing additional tips and best practice pointers before delving deeper into a topic..

For example, in one of the opening chapters, beginners are advised about the use of $.noConflict (for avoiding conflicts with other libraries) straight off the bat (which was good to see). I should also mention that Jake provides those coming from a pure JavaScript background some clear examples of where a library like jQuery can significantly decrease the time they spend coding solutions (which is ideal for setting up the stage for the rest of the book).

Early on, readers are introduced to essential tools such as Firebug for in-browser debugging and MAMP/WAMP/Apache in case a local development environment is desired for testing $.ajax() calls before they see any jQuery code.

To many of us that have been using jQuery for years, these are very obvious but the book gets plus points for highlighting these early in case a beginner isn’t aware of them. 

Now, what I personally look for in a book on jQuery for beginners is a comprehensive explanation of core fundamental concepts such as:

1. How jQuery lets you ‘query’ the DOM through selectors and the differences between class, ids and attribute/pseudo selectors.

2. What event delegation is and how .bind(), .live() and .delegate() can be used. What the difference between them is and where one may be better suited to a problem than another.

3. Basic concepts like how to use animation convenience methods such as .slideUp()/.slideDown() as well as the more important .animate()

4. A well-explained summary of $.ajax() including coverage of error handling, data types etc. (note that a number of new features were introduced to $.ajax() in jQuery 1.5, but these are likely not to appear in any published titles for another few months).

Smashing jQuery provides well written chapters on all of the above and I would add that the book also contains ‘cookbook’ style examples throughout for anyone wishing to expand on what we provide over at http://api.jquery.com. This makes it ideal for those wishing to both learn and test out their new skills with practical tutorials.

One potential downside of this aspect of the book is that (unlike say, Code Lindley’s jQuery Enlightenment book) Smashing jQuery doesn’t contain links to online examples on JSBin or jsFiddle, something that I think may have made it easier to beginners to visualize. 

This can be taken as a good or bad thing – re-writing out the examples yourself is probably a good exercise that can help familiarize yourself with the library (and it wouldn’t take you more than a few minutes to do this) so weigh the knowledge provided with how important this might be to you.

Applying what you’ve learned & Plugin Authoring

As a beginner, if you’re coming from a web design background, one of the first things you’ll want to do once you’ve learned a little jQuery is see first-hand how it can be used to enhance your site. Jake’s book has a comprehensive section dedicated to this and covers creating your own UI elements with jQuery such as accordians and tabbed content. (I would have liked to see a little more tie-in with jQuery UI here, but he mentions it in more detail in this next section).

As mentioned, Smashing jQuery also includes an entire section dedicated to writing plugins from a beginner’s perspective. Learning how to encapsulate your code in a clean re-usable form (eg. plugin authoring) is very much a logical next step once you understand the basics behind how jQuery works so this was something I was quite pleased to see included. 

Not all books that cover fundamentals include a guide on how to write your own plugins from scratch and I think Jake does a terrific job of both laying down the foundations of how to do this, but also guiding you through the process of converting your code into a plugin.

One of the last chapters in Jake’s book is on jQuery Mobile. I had personally been expecting tutorials on how to use it rather than a high-level summary (what is provided), however given the publishing dates on Smashing jQuery, it’s very possible that we hadn’t released jqMobile in time for him to cover this adequately. 

In my opinion, this shouldn’t really matter as once you know enough to dive into jQuery Mobile, the official API and examples should be sufficient to help you get started.

All-in-all Smashing jQuery is quite a solid book and I’d recommend picking it up if you’re new to jQuery and would like a good reference to help take your skills further. If you would like to read up some more on Smashing jQuery, you can find it on Amazon.com and other e-tailers.

Alternatively consider checking out Cody’s book (or Rebecca Murphey’s jQuery Fundamentals) as these are also good alternative titles.

Before we go, some tips I might offer other authors looking to write about beginners jQuery are the following:

 * Please try to explain to beginners the performance differerences between using ids, classes and other types of selectors. Quite often beginners interchange these without a second thought and I think it would be beneficial if they were made aware of the speed-differences from the get go.

 * Consider covering the differences between similar/often confused jQuery methods such as .map() and .each() etc. Beginners (particularly those coming from a vanilla JavaScript background) often want to iterate over arrays and clearing up any confusions they may have here would definitely be useful.

and that’s it!. The next book I’ll be reviewing on the site will be Eloquent JavaScript from Marijn Haverbeke. I’ve been recommending his open-source book for quite some time so it’ll be interesting covering the paperback version once I’m through reading it!

If you have a new book our or are reading a book you’d like to recommend to the rest of the community, plese feel free to leave a comment below or get in touch. Cheers until next time! – Addy.

 

12 Comments

    • Hey Neil,

      The distinctions I would make between Novice to Ninja and Smashing jQuery are that the Sitepoint book (in my opinion) focuses quite heavily on providing more practical examples wheras Smashing jQuery provides a balance between examples and explanations. It really depends on what you're trying to get our of a beginners book on jQuery – if you're trying to get a deeper understanding of how it works, I would almost definitely recommend Smashing jQuery. If however you already have a pretty good knowledge of the basics and are looking for ways you can tweak your skills a little further through tutorials, the Sitepoint book may be a better option.

      I hope that helps!

      Addy

    • Hey Neil! I responded to this in detail before but it looks like IntenseDebate may have eaten it up. To recap: Sitepoint is great if you're looking for more tutorials and cookbook style examples, Smashing jQuery is better is you're after explanations of fundamental concepts and are approaching jQuery as an absolute beginner.

  1. Pingback: Smashing jQuery | jQuery Academy

Leave a Reply

Required fields are marked *.