an eBook by TJ Holowaychuk. It
includes a PDF and sample source code, and costs \$4. The book covers
concepts like closures and scoping, prototypal inheritance,
metaprogramming, testing with JSpec, and creating a jQuery clone.
or introduction -- it explains scope and
var before you've
even had a chance to start your coffee. The style is pragmatic and
straightforward. Simple code examples frequently highlight ideas, and
other programming languages are mentioned to give a sense of
familiarity. Chapter 2, which covers prototypal inheritance, is
developers, because it draws sensible parallels with traditional OO
classes. Holowaychuk also presents a simple
implementation that features inheritance and the ability to append
The metaprogramming chapter deals with an example based on
Sinatra. This is based directly on Holowaychuk's Express project,
able to define methods for each HTTP expression using metaprogramming:
Although we could simply copy and paste the get() function above to start cre- ating our del(), put() and post() functions, we will take a meta-programming approach to solve the problem.
The next chapter deals with testing, using Holowaychuk's other project,
JSpec. This is a Behavior Driven Development (BDD) style of testing. This leads nicely into Chapter 5.
Creating a jQuery Clone, which explains how to create a jQuery clone
using BDD. This should appeal to those of you who find it difficult to
projects. It's also a good example because most of us use jQuery without
really understanding how it works.
The final chapter, Tools Of The Trade, covers popular libraries and
neatly links together TJ Holowaychuk's work to produce a coherent guide
the book, which will appeal to those of you who are full-time Rubyists
that it's only \$4 it's a great deal too -- highly recommended.
I used Calibre to copy the PDF to my Kindle, and the formatting wasn't
great. The header and footers and table of contents need to be removed.