I was excited to sit down and read the newly-published JavaScript & jQuery by Jon Duckett, produced by the team behind the hugely well-received HTML & CSS book. It's a large and beautifully-designed tome aimed at newbie developers with familiarity with HTML/CSS but no experience with programming in the browser. In this post I'll offer some thoughts and feedback on a couple of aspects of the book, but the TL;DR version is: if you're new to front-end web development, buying this is a no-brainer.
Things that are amazing about the book:
- It's very thorough. It rarely rushes (it's over 600 pages long) and builds things up logically, "linking" to future chapters where topics that are hinted at will become fleshed out. For someone new to the language it will give them a thorough grounding in many aspects of JS.
- It's good at answering the "why should I care?" question. Many of the code examples would be challenging to explain in purely theoretical terms, but by pairing them with screenshots of an attractively-designed mock website and using the code to manipulate the page, it's never a challenge to work out why a particular function or property is useful for making websites.
- It's gorgeously designed. The image on the book website of the for-loop flow diagram is probably the money shot, but generally it's a pleasure to read and may be the only published JavaScript book which will make you look cool while you're reading it in a coffee shop.
- It's great value. I came into the jQuery plugins section thinking it'd just be a way to pad out the last hundred pages or so with cheap instructions on using lightbox or something, but in fact it broke down the concepts and the DOM structure in almost obsessive detail and really got into the idea of building things in modular, configurable way. This is probably a bit advanced for the casual reader but represents good value for money (and plenty of repeat reading value when someone's digested the basics).
- It works for experienced developers as well as newbies. I've been writing JavaScript for quite a while these days but there were things in here that were new to me (I didn't know jQuery had a $(":header") selector...) and it also cleared up a few niggly things that I could never quite adequately explain to myself. In general it'd be a great reference book to have around an office or home, regardless of experience level.
Things that I found a bit weird about the book:
- Early on in the book there are code examples where a HTML element's class attribute is set to the string "true" or "false" depending on a Boolean. There's a quick disclaimer that this is rarely useful but it seemed odd to me to demonstrate it all rather than using a proper, semantic string for a classname.
- Some of the layout choices made it difficult to know what order to read things. It did sometimes feel that things had been placed on the page in order to achieve optimum symmetry or alignment rather than to aid readability. Here's an example:
Some pages have this style of text but without the numbering and it's not always clear if you're reading in columns or rows.
- In the section on JavaScript's Date object, the book explains that getMonth() will return a month number ranging from 0-11, but doesn't flag this up enough in my opinion (or attempt to explain why this is the case, although I have no idea either...). This feature often catches out newbie developers with JS.
- This code sample is a bit weird too. I understand the technique and why it's mentioned but I think it's an unhelpful and confusing thing to show to a new developer (mangling HTML to fix cross-browser issues?) and just serves to make them think browser support for fairly innocuous stuff is even worse than it is.
- As beautiful as the pages must've looked on a screen during design, the all-black pages lose something by the time a sticky set of paws like mine touch them:
- This page (and a few others like it) seemed a bit incongruous:
Again, I can see why they felt it should be included, but why give it a whole page? - The Handling Exceptions section feels a bit rushed and glosses over some concepts that are fairly challenging for anyone who's never come across try/catch blocks before (eg. most of the intended audience?). The tone of some of these pages was (to me) markedly more complex than other parts of the book.
- This sentence:
Maybe I'm just immature, but the quote marks around "closed" felt a bit melodramatic. - I can't really see any reason to angle the "blurb" text on the back cover except to make it feel like decoration and not something you'd actually read:
- Similarly, the angle of the text on the spine is different from all the other books I own which is mildly jarring to my OCD:
These are almost all minor quibbles though. There are a couple of clear code/printing errors (which the website already corrects) and one or two fonts which feel a bit large to read comfortably up close, but otherwise nothing to be worried about.
So, overall thoughts? Well, I already recommended the book to members of the HTML, CSS & JavaScript beginner's course I teach, which should tell you something. It's massively well-researched, works on multiple levels and has been put together in a beautiful, readable and understandable format. The team working on this have worked really hard to create something that will no doubt go down as a classic of the genre (as the HTML & CSS book has) and I've already had multiple people in my office eyeing up my review copy and asking to borrow it when I'm done.
If you're new to JavaScript or need a refresher, go out and pick this up – I was really impressed.
--
Note: the photos above are all from my fairly rubbish camera on my phone, so if text looks weird / blurry etc, that's almost certainly my fault. The book itself looks lovely – check out the website for more.
Full disclosure: I received a free copy of the book for review, but that's all.