Four good books that can help boost your JavaScript skills – #programming #bookreview

Ready for some enlightenment that can boost your JavaScript programming skills?

O’Reilly recently has published four books that can help you move from basic JavaScript library user to confident, experienced developer. 

“JavaScript started out as a simple and approachable front-end scripting language,” the publisher notes. “It has matured into a true cross-platform environment targeted by the latest emerging languages, frameworks, and developer tools.” The four new JavaScript books can help you “[l]earn how you can get the ultimate in responsiveness and interactivity from JavaScript, whether you use it on the front-end or server-side.” 

The four books are: JavaScript Enlightenment and DOM Enlightenment, both by Cody Lindley; Learning from jQuery by Callum Macrae; and Testable JavaScript by Mark Ethan Trostler.

#

JavaScript Enlightenment
Cody Lindley
(O’Reilly – paperback, Kindle)

Short, clear code samples are the stars of this fine, informative book. And most of the code samples can be viewed, executed and modified online using file links provided for the jsFiddle.net website.

The book’s goal is “to give the reader an accurate JavaScript worldview through an examination of native JavaScript objects and supporting nuances: complex values, primitive values, scope, inheritance, the head object, etc.” Cody Lindley adds: “I intend this book to be a short and digestible summary of the ECMAScript 3 Edition specification, focused on the nature of objects in JavaScript.”

Lindley keeps that promise in his 147-page book. His code samples rarely span more than a half page, and his explanatory paragraphs also are taut and to the point.

For example: “In JavaScript, objects are king: Almost everything is an object or acts like an object. Understand objects and you will understand JavaScript. So let’s examine the creating of objects in JavaScript….An object is just a container for a collection of named values (a.k.a properties).” 

Lindley’s book covers six of the nine native object constructors that are pre-packaged with JavaScript. The six are: Number(); String(); Boolean(); Object(); Array(); and Function(). He skips Date(), Error(), and RegEx() “because, as useful as they are, grasping the details of these objects will not make or break your general understanding of objects in JavaScript.” But he does hope you will learn them later, on your own. 

“JavaScript,” he writes, is mostly constructed from just these nine objects (as well as string, number, and boolean primitive values.) Understanding these objects in detail is key to taking advantage of JavaScript’s unique programming power and language flexibility.”

 # 

DOM Enlightenment
Cody Lindley
(O’Reilly – paperback, Kindle)

If you work with JavaScript, you probably rely on a Document Object Model (DOM) library such as jQuery to help you handle HTML scripting. 

But you can script the DOM without a DOM library, using JavaScript. Cody Lindley shows how in this excellent guide aimed at two types of developers who have experience with JavaScript, HTML, and CSS.

“The first developer is someone who has a good handle on JavaScript or jQuery, but has really never taken the time to understand the purpose and value of a library like jQuery,” Lindley writes. “The second type of developer is an engineer who is tasked with scripting HTML documents that will only run in modern browsers or that will get ported to native code for multiple OSes and device distributions (e.g., PhoneGap) and needs to avoid the overhead (i.e., size or size versus use) of a library.”

He notes that “HTML documents get parsed by a browser and converted into a tree structure of node objects representing a live document. The purpose of the DOM is to provide a programmatic interface for scripting (removing, adding, replacing, eventing, and modifying) this live document.”

Much of his 161-page DOM Enlightenment  focuses on how to work in JavaScript with “the most common types of nodes…one encounters when working with HTML documents.” He purposefully has “left out any details pertaining to XML or XHTML.” And, to help keep the book small, he has “purposely excluded the form and table APIs,” but adds: “I can see these sections being added in the future.”

Lindley also imposes a key technical limitation on the “content and code in this book….” It was, he says, “written with modern browsers (IE9+, Firefox latest, Chrome latest, Safari latest, Opera latest) in mind.”  

In keeping with the goals of O’Reilly’s Enlightenment series, explanations are short and concise and code examples are kept small. Also, the code examples are available online and can be displayed, run, and modified at the jsFiddle.net website.

 Cody Lindley emphasizes that he is “not promoting the idea of only going native when it comes to DOM scripting….” He hopes, instead,  “that developers may realize that DOM libraries are not always required when scripting the DOM.”

#

Learning from jQuery
Callum Macrae
(O’Reilly – paperback, Kindle)

Some developers work comfortably with jQuery yet have only a modest understanding of JavaScript.

Callum Macrae’s concise, well-written new book is intended to help fill that gap. It is “targeted at developers who know jQuery, but who don’t feel comfortable in their JavaScript knowledge or would just like to know more.”

The 102-page book focuses on the JavaScript code that jQuery covers up. It offers five chapters and two appendixes, with many short code examples and other illustrations. Much of the code is available through a GitHub repo.

Chapter 1, “Event Handling,” explains how event handling works in JavaScript and notes that “[e]vents are the heart of pretty much all web applications….jQuery provides a suite of functions to make event handling considerably easier than in JavaScript alone.” But these functions “add overhead and remove control from you, the developer. For this reason, it is important to know how you can handle events without jQuery in pure JavaScript.”

Chapter 2 covers “Constructors and Prototypes.” Writes Macrae: “Constructors are a way of creating objects, and can be initiated via the new keyword. Prototypes are one of the more powerful features of JavaScript, and allow the developer to declare a method or property that all instances of an object will inherit.” The chapter also can “help you understand how jQuery works, as jQuery itself uses prototypes.” 

Chapter 3 deals with “DOM Traversal and Manipulation.” Macrae notes that “jQuery includes a number of functions that make working with the DOM a lot easier than with JavaScript alone, which can be pretty ugly. However, the functions provided by jQuery can be rather hefty (especially in older browsers), and it is often a lot faster to just use pure JavaScript. Therefore, it is important to know how to work both.”

Chapter 4, “AJAX,” covers jQuery’s AJAX functions and concedes that they “offer some significant improvements over the native JavaScript AJAX features, as they are a lot easier to use.” Macrae explains: “AJAX is the act of making an HTTP request from JavaScript without having to reload the page; you could think of it as an inline HTTP request.” The chapter shows some jQuery AJAX requests and how those AJAX requests are sent in JavaScript. The goal is to help you get better at debugging code and also realize that “it isn’t worth loading the entire jQuery library to send a few requests and nothing else….”

Chapter 5, “JavaScript Conventions,” explains some “common conventions that you can use to improve your JavaScript…such as making your code more readable by using comments and whitespace correctly, optimizing your code in order to improve performance, design patterns, and some common antipatterns (code that causes more problems than it solves.)”

 This book is not recommended for persons who have no jQuery or JavaScript experience. Still, Appendix A, “JavaScript Basics,” provides a 28-page introduction to JavaScript, starting at “Hello World!” Appendix B, meanwhile, describes several applications and websites that can help you improve your JavaScript knowledge.

 # 

Testable JavaScript
Mark Ethan Trostler
(O’Reilly – paperback, Kindle)

“You have to test your code,” Mark Ethan Trostler emphasizes, “so why not make the process as easy and painless as possible?”

That’s a very desirable goal. Yet, as he notes a few sentences later, “testing–especially JavaScript testing–is complicated.”

For example: “Client-side JavaScript is especially difficult to test properly, as we have very little control over the environment within which our code runs. Multiple operating systems, multiple versions of operating systems, multiple browsers, multiple versions of browsers, not to mention plug-ins, extensions, different languages, zoom levels, and who knows what else, all conspire to hinder the performance of our applications. These permutations slow down, break, crash, and eat our applications for lunch. It’s a jungle out there!”

Trostler, a software engineer who works in test at Google, says his book “attempts to bridge the gap between sane development practices and JavaScript. JavaScript is a weird little language.” And he has aimed his guide at “people who encounter JavaScript professionally. Beginning, intermediate, or guru-level developers are all welcome, as this book has something for everyone.”

His 250-page how-to guide is structured into eight chapters that “tackle testable code in several steps. First we will investigate complexity. Then we will look at an architecture choice that attempts to limit complexity and coupling. With that as our foundation,” Trostler continues, “we will move on to testing, both at the functional level and at the application level.” From there, he delves into: code coverage; integration, performance, and load testing; debugging; and using automation in tests.

 “Writing unit tests for client-side JavaScript can be daunting,” Trostler states. “That means too many people don’t do it. This is not OK…”

Testable JavaScript is well written and rich with code examples, screenshots, diagrams and other illustrations. Whether you write client-side or server-side JavaScript — or both — or you are trying to rework some legacy files, Mark Ethan Trostler’s text can help you learn how to better create and maintain testable code.

Si Dunn

Learning JavaScript Design Patterns – For better JavaScript and jQuery coding – #programming #bookreview

Learning JavaScript Design Patterns
Addy Osmani
(O’Reilly, paperbackKindle)

New to JavaScript and jQuery or looking to expand your skills? This well-focused how-to guide can help you learn how to recognize and apply reusable design patterns to your coding.

“A pattern is a reusable solution that can be applied to commonly occurring problems in software design—in our case, in writing JavaScript web applications,” Addy Osmani notes in his new book. He is a developer programs engineer on the Chrome team at Google, and he is a frequent contributor to publications such as JavaScript Weekly.

“Another way of looking at patterns is as templates for how we solve problems—ones that can be used in quite a few different situations,” Osmani adds.

In his view, design patterns offer three key benefits for JavaScript and jQuery developers. First, the patterns offer “proven solutions….They provide solid approaches to solving issues in software development using proven techniques….” created and tested by others. Second, design patterns “can be easily reused” and offer “an out-of-the-box solution that can be adapted to suit our own needs.” And, third, “patterns can be expressive…there’s generally a set structure and vocabulary to the solution presented that can help express rather large solutions quite eloquently.”

Osmani also emphasizes that patterns do not provide “exact solutions…the role of a pattern is merely to provide us with a solution scheme.” But a key goal of his book is to convince JavaScript and jQuery  developers that “[r]eusing patterns assists in preventing minor issues that can cause major problems in the application development process.”

Learning JavaScript Design Patterns (235 pages) is structured with 14 chapters and an appendix.

  1. Introduction
  2. What Is a Pattern?
  3. “Pattern”-ity Testing, Proto-Patterns, and the Rule of Three
  4. The Structure of a Design Pattern
  5. Writing Design Patterns
  6. Anti-Patterns
  7. Categories of Design Patterns
  8. Design Pattern Categorization
  9. JavaScript Design Patterns
  10. JavaScript MV* Patterns
  11. Modern Modular JavaScript Design Patterns
  12. Design Patterns in jQuery
  13. jQuery Plug-in Design Patterns
  14. Conclusions

The appendix, “References,” includes 39 links for additional information related to JavaScript design patterns.

The author offers numerous code samples and graphics to help illustrate his explanations. He provides looks at more than 20 “classical and modern” design patterns in JavaScript. And he explains several choices for writing modular code, including the Module pattern, Asynchronous Module Definition (AMD), and CommonJS.

He also describes design patterns available within the jQuery library and explores “a number of jQuery plug-in patterns that have worked well for other developers in the wild.”

Addy Osmani’s well-written book provides clear guidance to understanding how adapting and using existing design patterns can help software developers work more efficiently and effectively in JavaScript and jQuery.

Si Dunn

Three new specialized how-to books for SharePoint, JQuery & Mac OS X Lion Server – #bookreview #in #programming

Here are three new books for those with at least some basic to intermediate experience with Microsoft SharePoint, or web development, or Mac OS X Lion.

Microsoft SharePoint 2010: Creating and Implementing Real-World Projects
By Jennifer Mason, Christian Buckley, Brian T. Jackett, and Wes Preston
(Microsoft Press,
paperback, list price $34.99; Kindle edition, list price $27.99)

If you have some background in Microsoft SharePoint and want to dig deeper, this book can help you learn how to use SharePoint to create real-world solutions to ten common business problems.

Each chapter is devoted to a single project, such as creating a FAQ system to help users quickly find answers to their questions, setting up a help desk solution to track service requests, or building a simple project management system.

The projects are based on “various scenarios encountered by the authors as we have used SharePoint as a tool to build solutions that address business needs….Each of the solutions has been implemented in one or more organization,” they state.

Do not jump into Microsoft SharePoint 2010: Creating and Implementing Real-World Projects until you have gained “a general understanding of the basics of SharePoint,” the authors caution. And note that SharePoint is not easily defined as one “type” of product.

If you keep in mind the process of building a house, they write, “SharePoint is like the various tools and materials, and the final business solutions you build are like the house. There are many features and tools in SharePoint, and within this book, you will see different ways to combine and structure them into business solutions.”

Their 403-page book is well written and cleanly organized with short paragraphs and many headings, step lists and illustrations. It also has an extensive index.

#

JQuery: Novice to Ninja, 2nd Edition
By Earle Castledine and Craig Sharkie
(SitePoint,
paperback, list price $39.95; Kindle edition, list price $29.95)

Technology changes fast, and web developers curious about JQuery will welcome this updated edition of Earle Castledine’s and Craig Sharkie’s book that first appeared in 2010.

This also is not a book for beginners. “You should,” the authors note, “already have intermediate to advanced HTML and CSS skills, as JQuery uses CSS-style selectors to zero in on page elements. Some rudimentary programming knowledge will be helpful to have,” they add, “as JQuery—despite its clever abstractions—is still based on JavaScript.” 

The authors offer high praise for the power of JQuery: “Aside from being a joy to use, one of the biggest benefits of JQuery is that it handles a lot of infuriating cross-browser issues for you. Anyone who has written serious JavaScript in the past can attest that cross-browser inconsistencies will drive you mad.”

They describe how to download and include the latest version of JQuery in web pages. And their book is organized to introduce JQuery features and code examples while also showing you, step by step, how to build a complete working application.

JQuery: Novice to Ninja, 2nd Edition has plenty of illustrations and is well indexed and written in a friendly, approachable style. 

#

Using Mac OS X Lion Server
By Charles Edge
(O’Reilly,
paperback, list price $29.99; Kindle edition, list price $23.99)

Yes, intermediate and advanced system administrators will find some useful information in this well-written and nicely illustrated guide.

“But the book,” says author Charles Edge, “is really meant for new system administrators: the owner of the small business, the busy parent trying to manage all of those iPhone and iPads the kids are running around with, the teacher with a classroom full of iMacs or iPads, and of course, the new podcaster, just looking for a place to host countless hours of talking about the topic of her choice.”

What Using Mac OS X Lion Server  does not cover is “managing a Lion Server from the command line, scripting client management, or other advanced topics.”

The topics it does cover include: Planning for and installing a server; sharing and backing up files; sharing address books, calendars, and iChat; Wikis, webs and blogs; building a mail server; building a podcasting server; managing Apple computers and iOS devices; network services; and deploying Mac OS X computers.

The author cautions: “In many ways, the traditional system administrator will find Lion challenging in its consumeristic approach. There is a lot of power under the hood, but the tools used to manage the server have been simplified so that anyone can manage it, not just veteran Unix gods.”

#

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