Node for Front-End Developers – Writing server-side JavaScript applications – #bookreview #in

Node for Front-End Developers
By Garann Means
(O’Reilly, paperback, list price $14.99; Kindle edition, list price $7.99)

Node is a JavaScript platform used to create server-side applications, communicate with the client, work with data, create dynamic web pages, and handle other tasks.

According to the Joyent Incorporated’s nodejs website: “Node.js is a platform built on Chrome’s JavaScript runtime for easily building fast, scalable network applications. Node.js uses an event-driven, non-blocking I/O model that makes it lightweight and efficient, perfect for data-intensive real-time applications that run across distributed devices.”

Node’s library has many modules created by developers who have focused on automating server-side development. But Garann Means’ new, 45-page book shows how you can get started programming for back-end servers using Node and JavaScript.  

Node.js is easy to download.  And, according to Node for Front-End Developers: “Node is easy to set up or very easy to set up. Node runs on Unix-compatible systems and, more recently, Windows.”

The how-to-get-started instructions, however, are a bit sparse in this thin book, and virtually nonexistent for Windows. Beginners who don’t have much experience with JavaScript may puzzle over a number of basic “What now?” and “WTF?” issues. 

Sparse information for Node beginners, however, is not limited to Node for Front-End Developers. I checked several other sources of  Node documentation and found similar problems. You’re just supposed to know this stuff, I guess. 

As one example, I followed the book’s instructions to create Node’s important package.json file, then discovered that what I had downloaded from Nodejs already contained a package.json file. In fact, it was now in several subdirectories. Was I supposed to edit it, instead? Delete it and replace it with my file? Had I just screwed up the installation by creating my own file?

After a lot of horsing around with node and npm at the command line and getting strange results at the not-quite “Hello World” level, I happened across a small note on the GitHub.com website. It stated that Node’s “Windows builds are not yet satisfactorily stable but it is possible to get something running.”

Especially if you resort to package managers to help you out.  And maybe get assistance from a Node guru. [See UPDATE below.]

Yes, I was indeed attempting a Windows setup, and I did get Node to partially work. But after several tries at reinstalling, rebooting, debugging, and attempting to supplement the book with conflicting bits of  information downloaded from the web, I gave up having “fun” with Node. (UPDATE: Recently, I reviewed my command line procedures a bit, looked again at my files and subdirectory structure and tried again. This time, Node works fine at the “Hello, World” level and beyond. I stand by my criticism that this book’s how-to-get-started instructions should be made clearer for Windows users. But I am at fault, too, for not figuring out what I was doing wrong much sooner.)  

Your results likely will be much better than mine, especially if you have more than novice experience with JavaScript.  and are using something other than (and better than?) a Windows machine. 

As for Node for Front-End Developers, the rest of the book appears to be an easy-to-use guide to getting a basic understanding of the Node platform. The code examples look good and are preceded by well-written explanations. I have now tested some of them successfully and plan to try a few of the longer, more-complex examples soon. wish I could have tested more of them. But I intend to keep this book and try Node again once easier and more stable Windows options are available.

The book’s chapters are:

  • Chapter 1, Getting Node Set Up
  • Chapter 2, Serving Simple Content
  • Chapter 3, Interaction with the Client
  • Chapter 4, Server-Side Templates
  • Chapter 5, Data Sources and Flow Control
  • Chapter 6, Model-View-Controller and Sharing Code

How-to-get-started instructions are vital in any programming and developer’s book, in my view. And they need careful preparation and presentation for every major operating system that is supported.

Countless beginners are looking for new programming and development paths and challenges, and many of them will buy books that are beyond their experience level so they can try to learn faster and backfill as they go. Most of them also won’t have the latest-and-greatest hardware and software. Therefore, minimum requirements need to be spelled out clearly, as well.

Don’t let my blunderings with Windows dissuade you from considering this book. Node has been hot, and if you have JavaScript experience at the browser level, Node for Front-End Developers can help you learn how to work on back-end servers, too.

It pays to be versatile in today’s fast-paced tech world.

But yeah, I probably do need a Mac and a Linux machine flanking my Windows PC.

#

Si Dunn is a novelist, screenwriter, freelance book reviewer, and former software technical writer and software/hardware QA test specialist. His latest book is Dark Signals, a Vietnam War memoir available soon in paperback. He also is the author of a detective novel, Erwin’s Law, a novella, Jump, and several other books and short stories.

About these ads

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s