Book Review: Effective JavaScript

I just finished reading Effective JavaScript, by David Herman. This is the latest edition to the Effective Software Development series. It follows the format for all the Effective books. There are 68 guidelines for developers to remember when working in the JavaScript language.

Like all Effective books, this is not a tutorial, and probably should not be your first JavaScript book. Usually, Effective books are great as your second book on a subject. I think Effective JavaScript is an excellent third book on JavaScript. Your first should be a good tutorial on the language. Your second should be JavaScript: The Good Parts (Douglas Crockford). This book should be next.

This book has seven different sections that will make yourself a better JavaScript developer. The organization helps developers (like me) who have quite a bit of experience in other languages, but are new to JavaScript.

The first chapter, Accustoming Yourself to JavaScript, will help you learn the idiosyncrasies of the JavaScript language. (Note: all languages have their idiosyncrasies, you just overlook the ones in your own favorite language). It will help you break those habits that are correct in other languages, but cause issues when you are working in JavaScript.

Then comes Variable Scope. This chapter provides great information about JavaScript's rules for variable scoping. Follow these guidelines, and you'll rarely be surprised by unfamiliar scoping rules in JavaScript.

Next is Working with Functions. This is the meatiest chapter of the book. Functions are the core building block for all JavaScript programs. You'll learn many techniques to compose functions. If you've never used a functional language, and you're unfamiliar with terms like higher order functions, closures, currying, and variadic functions, you may need to read this chapter twice. It's rather dense, and there is a lot of great information on how to build algorithms using proper, idiomatic JavaScript.

The next chapter, Objects and Prototypes, is very closely related. JavaScript isn't an object oriented language, but supports the concept that an object is a dictionary of string / value pairs. This chapter teaches you to work with that structure, including emulating many object oriented idioms in JavaScript. You'll learn about object prototypes, prototype inheritance, and JavaScript techniques for minimizing the visibility of object variables. This chapter, after the previous chapter, will make you a professional JavaScript developer. Even if you're familiar with JavaScript, these two chapters will make you a better JavaScript developer.

The next chapter, Arrays and Dictionaries, provide guidance on using two of the most common collection types in JavaScript. The information in this chapter will help you make better designs. You'll learn more about the capabilities of the different collection types, and how to make the best decisions for your code.

You're finally ready for Library and API Design. This chapter provides guidance on how to create libraries and APIs that are easy to use correctly, and hard to mis-use. You know this is important if you've been developing software for any period of time. You've used well designed libraries, and you've used libraries that are hard to use. The guidance in this chapter will help you make sure that you are creating software that is intuitive for others to use.

The final chapter, Concurrency, provides concise guidance on managing concurrency in JavaScript programs. You'll learn practical techniques for keeping your JavaScript programs responsive. You'll finish this chapter with a much better understanding of JavaScript's concurrency model. (It's different than C#'s, by the way). This chapter is a must read if you are creating modern JavaScript programs.

Is this book for you?

If you've been writing JavaScript for at least 6 months, you're ready for this book. I think every JavaScript developer will learn something from this book as well. At 200 pages, there's not any fluff, and it's a reasonably short read. It's well worth the time investment.

If you program in JavaScript professionally, this book is for you.

Created: 12/2/2013 4:59:57 PM

Current Projects

I create content for .NET Core. My work appears in the .NET Core documentation site. I'm primarily responsible for the section that will help you learn C#.

All of these projects are Open Source (using the Creative Commons license for content, and the MIT license for code). If you would like to contribute, visit our GitHub Repository. Or, if you have questions, comments, or ideas for improvement, please create an issue for us.

I'm also the president of Humanitarian Toolbox. We build Open Source software that supports Humanitarian Disaster Relief efforts. We'd appreciate any help you can give to our projects. Look at our GitHub home page to see a list of our current projects. See what interests you, and dive in.

Or, if you have a group of volunteers, talk to us about hosting a codeathon event.