Wednesday, April 28, 2010

jQuery: Novice to Ninja

Authors: Earle Castledine and Craig Sharkie
Format: Paperback, 300 pages
Publisher: SitePoint; 1st edition (February 22, 2010)
ISBN-10: 0980576857
ISBN-13: 978-0980576856

I was first introduced to jQuery a year or so ago when I read David Sawyer McFarland's JavaScript: The Missing Manual from Pogue Press, which was more about jQuery than learning JavaScript basics (as I had originally assumed). It was a happy accident though, and I discovered how to get a lot more out of JavaScript by leveraging the jQuery framework making my efforts generally more quick and less painful (well, I'm not lightning fast, but I'm not an expert, either). I've been looking for a "pure jQuery" book for a while, but there really aren't a lot of good books on the topic out there. When I saw the Castledine and Sharkie book was available, I jumped at the chance to review it.

Who should read this book? There was the usual blurb in the book's front matter about "If you're a front-end web designer looking to..." which I expected, but what are the minimal qualifications the reader should have before shelling out his or her hard earned dough for this text? Actually, the authors don't come out and say "you need to know JavaScript to such and thus level.." at first. On the other hand, they do say the reader should have intermediate to advanced HTML and CSS skill sets as well as stating some (ah, here it is) "..rudimentary programming knowledge will be helpful." Folks assume that JavaScript is "programming light", but it has the same basic rules and structure as other languages such as Python and PHP, so possessing an understanding in that area would seem to be at least a plus if not something of a requirement. Before I get ahead of myself though, it's time to move into the book proper.

Chapter 1 is pretty much a combination high-level overview for jQuery and an advertisement selling the audience on its virtues. I don't disdain this. After all, if you aren't sold on the value of jQuery for your web designs, why buy the book in the first place, right? If you're at your favorite bookstore (do people still buy books at stores rather than online anymore?) and you're trying to make up your mind about jQuery (let alone this book), skimming the first chapter should help you with your decision.

I actually got a bit of a lesson on CSS and JavaScript in the second chapter as I came across bits about adding and removing classes, event handlers, if statements and such. Like any (more or less) beginning programming book, there's always a struggle in deciding how much to assume your audience knows vs. how much to teach them in the book's content. That often spills over into deciding the style of the book. Should it be heavier on concept or hands on? I usually prefer simple, straightforward numbered steps, but while that can get you creating stuff that works, it's also important to understand why it works. Otherwise, the only thing you've learned is how to follow a list of instructions to create a specific effect. This book seems to combine these two elements, presenting the "steps" as a narrative that also contains the conceptual data.

About a quarter of the way through, I thought I'd see how much value the companion website added to the book. As usual, you can buy the book online from the publisher's site, download the sample code (so you don't have to keyboard all the code examples by hand), submit errata, and post questions on a discussion forum. I was looking for that magic combination between web and hardcopy that would make learning a new language or library streamlined. Unfortunately, I didn't find it. Let's face it, programming is hard for the beginner. I'm not trying to be discouraging, but it takes not only a lot of practice and dedication to learn programming, but you have to possess the ability to conceptualize problems as solvable using programming logic. Not everyone can do that, or at least, some people are better at it than others.

Learning from the book will be relatively easy if you are an experienced web designer with knowledge of HTML, CSS, and some JavaScript (the more the better) and/or are reasonably proficient at web programming (or have the right wiring in your brain pan for this kind of learning). I wouldn't recommend tackling jQuery if you've never written in JavaScript at all before. One person's "easy" is another person's "this is really hard." Heading into this with your expectations grounded in reality will help. To its credit, the book does start you out with a vanilla web site and shows you how to augment it with jQuery, which is the way to do it. Build the structure first, then style it, and then add the action and interaction.

I didn't test the code, so I can't tell you how well it works (and I've encountered books before where it was impossible for the sample code to produce the effect described by the book's text). You probably want to hit the book's web site and review the errata section, making some notes in the book before performing the exercises, just to prevent a few minutes (or hours) trying to solve a problem that's already known and corrected. You can also visit the discussion forum to see if other readers have had common issues with specific areas of the book. Proficiency in learning is all about doing your homework, both within and outside the text.

A lot of people, even experienced developers, will just Google the effect they want to produce, find the relevant jQuery online, download, copy and paste, and then perform a little minor tweaking to get it to work on their site. This book proposes to actually teach you how to write your own jQuery, or at least, teach you how to understand the work of others that you want to use for yourself (with the permission of those "others", of course). Expect to get around halfway through the text before you've learned enough to get you to the point of starting to write your own original code.

Starting out as a jQuery novice is easy. We all start there (assuming we're all trying to learn jQuery). How far you get into the "ninja" range depends on how far you progress into the book and how well you integrate the learning into your programming activities. While I found the book a good jQuery guide for beginners, I don't think it's one-stop-shopping as far as turning the reader into a world-class jQuery guru...not unless the reader sticks with it, goes through the book, goes through certain portions of the book again, and keeps expanding his or her knowledge and experience.

jQuery: Novice to Ninja may not actually make you the master of the art of invisibility, or even the art of jQuery, but it is a very slick book, and the best example of a jQuery book I've seen cross my path yet. If you're looking for jQuery "ninjahood", this book might not garner you that honor all by itself, but it should put you well down the right path to that destination.

Share/Bookmark

No comments:

Post a Comment

Please make comments.