this space intentionally left blank

February 28, 2013

Filed under: tech»education

JavaScript for the Web Savvy

On Tuesday, I published a repo to GitHub containing a JavaScript textbook that I've started writing under the working title JavaScript for the Web Savvy. As soon as I have some more work committed, I'll create a GitHub Pages version for easy viewing, but right now you'll need to pull the repo to read the built pages (or build them for yourself). I wanted to go ahead and get the drafts out as I work on them, in order to incorporate any feedback students and other readers might want to offer.

In order to build the book, you'll also need NodeJS with Grunt, grunt-contrib-less, and grunt-contrib-watch installed. In addition to using LESS and RequireJS, I've written the World's Worst Template system to reduce boilerplate. The repo contains fully-built versions of the site, so you don't need to build it to read, but it would be helpful for pull requests and testing.

Why write another JavaScript textbook? Ever since I started teaching a year ago, I've been looking at the most commonly-recommended books for my students to use. This isn't easy: technical books are hard to evaluate, since they may be hard to find and they're incredibly expensive. Those I have tried tend to get ruled out for several reasons:

  • They're out of date. The original textbook for the course had students using document.write(), adding scripts in the head, and (worst of all) updating document.body.bgcolor to change a background. I couldn't get away from it fast enough. Modern JavaScript has evolved quickly, and students need a book that has kept up with it.
  • They're aimed at experienced developers. My current textbook choice is David Flanagan's The Definitive Guide. It's a great book, and I chose it because that way students can get a valuable reference using their financial aid. But it's not a good book for beginners. Hopefully, by the end of the class, students aren't beginners, and it makes more sense to them, but that doesn't help them when they're struggling.
  • They only teach JavaScript the language, or a specific JavaScript library, not both. Eloquent JavaScript is a perennial favorite among the web developer comunity, but it's primarily focused on functional programming in JavaScript, not web development. It's hard to keep students' attention without the web side of things--but likewise, I don't want to create a bunch of jQuery developers who don't know the difference between an object and an array. I need a book that covers pragmatic, practical JavaScript.

My goal with JavaScript for the Web Savvy is to write a smart, accessible textbook for people who know a little HTML/CSS, but want to start adding JavaScript to the mix--including the common case of people who know just enough to add a jQuery plugin to the page, but not enough to troubleshoot when something goes wrong. It will teach coding using the actual tools used by real web developers, like the browser console. I also want to experiment with visualizations and interactive elements for common trouble spots where students struggle, like loops and functions. Finally, I want it to be free and freely-available, so students without a lot of money aren't having to pony up for expensive technical books they may or may not use after the class is over.

As I'm working on this project, I'll commit to the repo and update GitHub. If anyone wants to file pull requests for things that are technically wrong, confusing, or need more explanation, please feel free. Contributors will get their names in a credits section, although I will have to ask that copyright be assigned to me as a precaution, in case I ever wanted this to see print. If nothing else, I hope people find it to be useful as a resource. Teaching has become one of the most rewarding parts of our move to Seattle, and I don't see any reason that should be limited to just my classroom.

Future - Present - Past