JavaScript Technology Writing

My Last O’Reilly Book

The editor for JavaScript Cookbook, 3rd edition, just sent me a draft to review and comment on. This is the last of the O’Reilly books that will feature my name on it. I wasn’t actively involved in it; my name is on it because they kept about 15% of my old content. New authors, Adam Scott and Matthew MacDonald, took on the majority of the work.

They did a good job, too. I particularly like the chapter devoted to error handling. The days of using an alert message to debug have been gone for decades, and JS developers now have sophisticated error-handling techniques and tools. It is no longer your Mom’s JS.

Good. I’m happy the language and its uses have evolved. But…

I sometimes miss the simpler days when an alert was your JavaScript best friend.

I’ve been working with JavaScript since it was first introduced over 25 years ago. Not just traditionally in the web page, either. I worked on a small project that used Netscape’s server-side JavaScript (LiveWire) in the 1990s. It was so very different from an application made with Node. as you can see for yourself from an old Dr. Dobb’s article on LiveWire.

Writing about JavaScript today requires a different mindset than writing about it years ago. Then, JavaScript was laughably simple. It’s simplicity, though, was also its strength. In its infancy JavaScript was so embraceable. You could literally toss a tiny blurb of JS into an HTML file, load it into a browser, and see an immediate implementation. You didn’t have to fiddle with compilation, installing special developer tools, or figure out a framework.

My first book on JavaScript, the JavaScript How-To for Waite Group Press was published in 1996. The hardest part of writing it was trying to find enough about JavaScript to actually fill a book.

JavaScript today, or ECMAScript if you want to be pure, is not so simple. And oddly enough, that’s its strength now: it is powerful enough to meet today’s very demanding web applications. And the hardest part of working on a book such as the JavaScript Cookbook is limiting yourself to the essentials, because you could easily write three or four books and still not envelop the world of JavaScript as it exists now.

When O’Reilly asked me to do a new edition of the Cookbook I knew I just didn’t want to take on that kind of burden again. It was hard to give up control of one of my favorite books, but after 25 years of working to deadlines and dealing with tech editors, I knew I just didn’t have the energy or patience to do the book justice. I knew it was time for me to hang up my drafts.

Thankfully, the new Cookbook team have done an exceptionally good job. I’m happy to have my name on the Cookbook, one last time.

If I write now, it’s solely for me: my ideas, my deadlines, my expectations. I may only write in this space. I may try my hand at self-publication.

Who knows? Maybe all I’ll do is write incendiary commentary in Facebook and Twitter and see how often I can get banned.


My Current Version of Learning Node

As we finished up Learning Node, 2nd, the Node.js Foundation released Node version 6. I quickly did a run through to see if I needed to modify the book text. Yes, indeed, I did.

One of the major changes was how new Buffers are created. This is a major change, considering how integral Buffers are to Node. I hastily re-wrote the section on Buffers in the book, noting that the existing examples demonstrate how to create a Buffer in Node 4.x, but not Node 6.x and later. I also provided additional examples for Node 6.x.

Another major change was how to refer to the fast lane version of Node.js, originally called “Node Stable”. Now, it’s referred to as “Node Current”.

I may have influenced this change. I filed bugs last year about the Node documentation.  One bug had to do with the confusion surrounding which version of Node should be the “default” API.

The Node.js Foundation recommends the LTS versions for production use, because of their long-term stability (hence the name). However, if you access API documentation for Node.js directly, such as searching for Buffer in Google, you’ll get the new Current version.

We went back and forth in the comments about the problems inherent with having the least stable API as the default documented API. I also repeatedly pointed out the problems when you have multiple “current” versions of Node (LTS and Stable), and how would people know which is the current version of Node.js?

To be honest, I didn’t see renaming Stable to Current to be one of the possible solutions. That’s a bit like sweeping dirt under the rug. Oh look! We can’t see the dirt now!

Back to finishing up the book. I quickly changed Stable to Current where applicable. What’s done is done. I hope the book does well.

This is my last book on Node. I may, in the future, write other books on technology, but not Node. Change is the byword for the Node community and that doesn’t translate well when it comes to writing books. I will, eventually, return to technical writing here at Burningbird in addition to my other writing, and I will write about Node. But no books.

And when I write on Node, it will be the current version. Whatever that may be.



Technology Writing

Learning Node, 2nd Edition is now live

Learning Node 2nd cover

Learning Node, 2nd Edition is now in production and should be hitting the streets within a few weeks. We had a bit of excitement when Node 6.0 was rolled out, just as we entered production. However, this edition of the book was specifically designed to accommodate Node’s rather energetic release schedule, and the book survived with only minimal changes.

In this edition, I focused heavily on the Node core API, rather than third-party modules. I figured the book audience either consists of front-end developers working with JavaScript in the browser, or server-side developers who have worked with other tools. In either case, the audience wants to know how to work with Node…not this module or that. Node, itself.

My one trip into the fanciful was the chapter on Node in other environments. In this chapter, I had a chance to introduce the reader to Microsoft’s new ChakraCore for Node, as well as using Node with Arduino and Raspberry Pi, and with the Internet of Things (IoT). I figured by Chapter 12, we all deserved a special treat.

The book’s Table of Contents:

1. The Node Environment
2. Node Building Blocks: the Global Objects, Events, and Node’s Asynchronous Nature
3. Basics of Node Modules and Npm
4. Interactive Node with REPL and More on the Console
5. Node and the Web
6. Node and the Local System
7. Networking, Sockets, and Security
8. Child Processes
9. Node and ES6
10. Full-stack Node Development
11. Node in Development and Production
12. Node in New Environments

A more detailed TOC is available at O’Reilly.

I had a good crew at O’Reilly on the book, and an exceptionally good tech reviewer in Ethan Brown.