Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
skip to main content
Skip header Section
Effective JavaScript: 68 Specific Ways to Harness the Power of JavaScriptDecember 2012
Publisher:
  • Addison-Wesley Professional
ISBN:978-0-321-81218-6
Published:06 December 2012
Pages:
240
Skip Bibliometrics Section
Reflects downloads up to 28 Dec 2024Bibliometrics
Skip Abstract Section
Abstract

Its uncommon to have a programming language wonk who can speak in such comfortable and friendly language as David does. His walk through the syntax and semantics of JavaScript is both charming and hugely insightful; reminders of gotchas complement realistic use cases, paced at a comfortable curve. Youll find when you finish the book that youve gained a strong and comprehensive sense of mastery. Paul Irish, developer advocate, Google Chrome This is not a book for those looking for shortcuts; rather it is hard-won experience distilled into a guided tour. Its one of the few books on JS that Ill recommend without hesitation. Alex Russell, TC39 member, software engineer, Google In order to truly master JavaScript, you need to learn how to work effectively with the languages flexible, expressive features and how to avoid its pitfalls. No matter how long youve been writing JavaScript code, Effective JavaScript will help deepen your understanding of this powerful language, so you can build more predictable, reliable, and maintainable programs. Author David Herman, with his years of experience on Ecmas JavaScript standardization committee, illuminates the languages inner workings as never beforehelping you take full advantage of JavaScripts expressiveness. Reflecting the latest versions of the JavaScript standard, the book offers well-proven techniques and best practices youll rely on for years to come. Effective JavaScript is organized around 68 proven approaches for writing better JavaScript, backed by concrete examples. Youll learn how to choose the right programming style for each project, manage unanticipated problems, and work more successfully with every facet of JavaScript programming from data structures to concurrency. Key features include Better ways to use prototype-based object-oriented programming Subtleties and solutions for working with arrays and dictionary objects Precise and practical explanations of JavaScripts functions and variable scoping semantics Useful JavaScript programming patterns and idioms, such as options objects and method chaining In-depth guidance on using JavaScripts unique run-to-completion approach to concurrency

Contributors
  • Mozilla Corporation

Reviews

Panagiotis Louridas

The "Effective Software Development Series" enjoys a venerable reputation, starting from the first C++ book published back in the 1990s. It was therefore with high expectations that I reached for this book. I am glad I was not disappointed. The books in this series take you for a ride among various language features, not with the intention of teaching you how to program in a language, but to show you how to program well in it. They are usually composed of many small items, organized into chapters. A typical item is two to three pages long, dealing with concepts like dodgy traps, bad style, programming idioms, or small design patterns, among others. Items are grouped into a small number of chapters, and cross-reference each other extensively. This serves well to show how different concerns affect a particular programming issue. The chapters in this book move from general issues to variable scope, working with functions, objects and prototypes, arrays and dictionaries, libraries and application programming interface (API) design, and concurrency. That's a good list, even though I would have appreciated some extra material on the design of libraries and APIs, like how to tackle the lack of namespaces in JavaScript, or some discussion on performance optimization issues. That said, one of the advantages of the book is its brevity. The items contain code snippets, some of which are remarkably elegant. For instance, item 37, "Recognize the Implicit Binding of This," uses the example of "reader" for comma-separated values (CSV) files, written in seven lines of code. It serves well to show the programming style that both enchants and exasperates JavaScript programmers. Other items, like item 6, "Learn the Limits of Semicolon Insertion," showcase slips to which even knowledgeable developers may very well succumb. David Herman has written a book that benefits from repeated reading (the same is true for the other books in the series). The information can be dense, and the reader may have to jump between related issues to get the full picture. Because of this, it may take repeated readings to make sure that everything falls into place. Although this is definitely not a book for the novice programmer, it could be approached by people new to JavaScript but with extensive experience in some other programming language. JavaScript programmers with a couple of projects under their belts could use it as a stepping stone on their path to expert status. Along with the rhino book [1] and a few other books on the language [2,3,4], I expect this book to find its way onto the shelves of most JavaScript developers. More reviews about this item: Amazon , GoodReads Online Computing Reviews Service

Alexandre Bergel

The JavaScript wave began in 1995, and has largely become established as the new standard for creating lightweight client applications. JavaScript has a not-so-flattering reputation among programming language experts because it contains many odd features. Consider the (in)famous command, "3 + true," which surprisingly returns 4. JavaScript was rapidly conceived (in about 10 days, according the preface of this book) and has been rapidly adopted, meaning that odd and suboptimal aspects of the language are likely to stay with us for a long time. We have to deal with them, and this book is about exactly that: how we cope with the mysterious aspects of JavaScript. The author aims to uncover many of the details and oddities an experienced JavaScript programmer might easily stumble on. The book reviews 68 items of the language that are considered error prone (for example, "Item 32: Never modify __proto__") or counter-intuitive (for example, "Item 3: Beware of implicit coercion"). The book concisely details obscure aspects of JavaScript. For example, it describes how to operate the lookup function over the parent and prototype links (Item 30). The book makes intensive use of short and independent examples, which are easily reproducible with a text editor and a web browser. The book is well written, with a pleasant writing style and format. Having the content broken down into items makes it easy to browse and search for particular solutions. By focusing on singular aspects of JavaScript, the book often seems more intent on solving a technical challenge in JavaScript than on addressing practical software engineering issues. Several items gave me this feeling, including items 23, 24, 29, and 32. For example, "Item 23: Never modify the arguments object" advises the reader not to modify the collection of optional arguments. In fact, it is well known that programmers have a reputation of taking advantage of unthinkable situations, and modifying the "arguments" object indeed goes against all good programming practices. It is an easy path that produces hard-to-maintain software code. The reader is therefore left with the question of how often such problems occur in practice. While the author highlights some important points about JavaScript, this book is not about learning the language. Those who wish to learn JavaScript might consider reading another book [1]. On the other hand, people who make heavy use of JavaScript will find this book valuable. However, finding a particular point treated as an item in the book must not be taken as permission to use it in your own code. The book is about working with the oddities of JavaScript, and should not be considered as carte blanche to employ these mechanisms in your own code. Be kind to the engineer who will maintain your code in the future. More reviews about this item: Amazon , GoodReads Online Computing Reviews Service

David E. Robbins

An in-depth guide to the mastery of JavaScript is provided in this book. Written by a member of the ECMA TC39 committee, which is responsible for the standardization of JavaScript, the book deals with some of the advanced JavaScript concepts that trip up new users, and offers detailed examples of techniques for harnessing the power of JavaScript. This is not a book for beginners. Those looking for an introduction to programming concepts or to JavaScript in particular will find it hard to follow. However, readers with a fundamental understanding of JavaScript, and perhaps experience with a few projects in that language, will find it both enlightening and deeply practical for enhancing their mastery of the language. The author has structured the book as a collection of 68 items, grouped by general subject area into seven chapters. Each item provides an imperative tip for either avoiding a common pain point in JavaScript or enhancing the usage of JavaScript's features. Chapter 1 begins with seven items dealing with JavaScript as a whole, such as its handling of strings and the variations between implementations of JavaScript. In chapter 2, ten items cover the intricacies of variable scoping, while chapter 3 provides 12 items describing the advanced use of functions. The 13 items in chapter 4 deal with the use of prototypical inheritance and object-oriented programming in JavaScript. Chapter 5 contains ten items describing the use of arrays and the creation of dictionaries with object literals. The final two chapters represent a shift in emphasis from JavaScript language features to design patterns for maximizing the functionality of the language. The eight items composing chapter 6 provide idioms for the construction of JavaScript application programming interfaces (APIs) and libraries, while the eight items in chapter 7 deal with asynchronous programming in JavaScript. The author writes in an easy-to-read style, and has included several code examples for most items (nearly one-third of the book is devoted to example code). Notably, the code examples include full-color syntax highlighting, making them a joy to read. Overall, this book represents an effective tool for those looking to enhance their mastery of the programming language of the web, and is recommended for those already familiar with JavaScript who are looking to take their skills to the next level. Online Computing Reviews Service

David Bellin

Every once in awhile, a book comes along that is actually useful and accomplishes what it sets out to do. This is one of those: a wonderful, succinct text on mastering the ins and outs of using JavaScript effectively. Thankfully, the author does not try to fill out the pages with an introduction to programming, general analysis questions, or the like. He assumes the reader has programming experience, if not in JavaScript directly. The title claims "68 proven approaches for writing better" code, and that is exactly the case, from just getting started to some tidbits I hadn't thought of. Chapter 1 starts the flow with seven basic items, such as reminding the coder that the use of "==" is dangerous when using mixed types. Chapter 2 contains ten approaches to variable scoping, followed by a chapter with 12 angles on working with functions. There's more significant content in chapter 4, which focuses on objects and prototypes. Chapter 5 covers arrays and dictionaries, and an all-too-brief chapter 6 attempts to suggest some approaches to the design of libraries and application programming interfaces (APIs). This is the only area where more pointers would have been helpful. The final chapter gives eight tips on the use (and the dangers) of concurrency in JavaScript. I wish I'd had access to this book earlier in my life. It's clear, well written, helpful, and completely pragmatic (in the best sense of the word). If you are even considering JavaScript coding, read it. If you've already coded, you need it as well. Online Computing Reviews Service

Access critical reviews of Computing literature here

Become a reviewer for Computing Reviews.

Recommendations