Book Review: Web Development with Node and Express

← back to the blog

Even among the bewilidering array of backend web languages and frameworks, Node.js stands alone. It isn't a language - it's just an implementation of Javascript, and is it isn't really a framework, either. At it's most basic level, it feels more like a Javascript API for configuring a server.

Express is integral to most Node applications in that it sits on top and enforces a more familiar MVC-like structure. At the heart of Express are routes - functions that take an HTTP request and turn it into a response. They are (almost) equivalent to Views in Django and felt much more familiar to me. Add in database interaction on one side and HTML templating on the other and you have everything you need.

Chris Bucheler (@cwbucheler) has a beautiful tutorial putting the whole stack togther into a functioning website. If he could have written a 306 page book, I'm sure it would have told me all I need to know to get started with Node.

But he didn't. Instead, "Node and Express" is meandering, and frustratingly thin where it counts. For example, a chapter on "Security" devotes 18 pages to HTTPS, the basics of authentication, problems with the overabundance of passwords on the Internet (and introduces OAuth as a strategic alternative), before getting into how to set up basic authentication (using the npm module passport). These are no doubt important issues, but they aren't critical reading for people who have experience with other platforms and/or who just need to get a prototype up and running.

Another chapter is called Persistence and covers that topic in a somewhat academic way, which would be fine if it wasn't the only information on interacting with MongoDB in the whole book. Mongo peculiarities like atomic queries and upserts are glossed over so fast that you can't do much apart from reproduce the examples in the book.

Part of this isn't so much a flaw in the book as it is the challenge of the source material. By design, Node (and Express) don't have many particular dependencies. So Mongo, passport and similar resources that tend to get used with Express are not really part of Express itself. This means that, strictly speaking, they might be "out of scope" as far as a book on Express is concerned.

Still, while the modularity of Node is wise (I don't like Jade, and am glad Express doesn't force it on you), there has to some concession for those of us just starting out. I could use a bit more on Mongo to build even a really simple Express app, and I suspect most beginning Node developers are in the same boat.

"Web Development with Node and Express: Leveraging the Javascipt Stack" is written by Ethan Brown, published by O'Rielly, and available at Amazon.