Become a fan of Slashdot on Facebook

 



Forgot your password?
typodupeerror
×

Submission + - Drush for Developers, 2nd Edition

Michael Ross writes: Robert, here is the book review meta-data: author: Juampy Novillo Requena pages: 180 publisher: Packt Publishing rating: 7/10 reviewer: Michael Ross ISBN: 978-1784393786 summary: Recommendations for improving Drupal development with Drush.

As with any content management system, building a website using Drupal typically requires extensive use of its administrative interface, as one navigates through its menus, fills out its forms, and reads the admin pages and notifications — or barely skims them, as they have likely been seen by the site builder countless times before. With the aim of avoiding this tedium, speeding up the process, and making it more programmatic, members of the Drupal community created a "shell" program, Drush, which allows one to perform most of these tasks on the command line. At this time, there is only one current print book that covers this tool, Drush for Developers, Second Edition, which is ostensibly an update of its predecessor, Drush User's Guide.

Both editions were written by Juampy Novillo Requena, although in the transition from the first edition to the second, both the author's name and the book title were changed. The most recent edition's title seems redundant, because of course such a book is going to be "for developers"; after all, who but Drupal developers would have an interest in Drush? The edition under review was published on 29 January 2015 by Packt Publishing, under the ISBN 978-1784393786. (My thanks to the publisher for a review copy.) At 180 pages, this edition is longer than its predecessor, but still a manageable size. Its content is divided among half a dozen chapters. Anyone interested in learning more about the book may wish to visit the publisher's website, which provides a brief description of the book, the table of contents, free sample content (Chapter 3), and the source code files.

The first chapter begins by presenting a brief comparison of the steps needed to run database updates on a Drupal website, using the GUI versus using Drush. As expected, the latter requires fewer steps. The author then discusses the prerequisites for installing Drush in a Linux or OS X environment. For Windows, the given download URL, http://www.drush.org/drush_win..., is incorrect and should instead be http://drush.readthedocs.org/e.... The author states that "the installer installs an older version of Drush," but actually the installer has disappeared from its former locations. Fortunately, the current Windows archive file has the latest version as of this writing, 7.0.0-alpha7. This version is more recent than the alpha5 used in the book, but the commands and their options seem identical. On the other hand, it is a large archive file containing the Drush application files, Msys, PHP, and parts of PEAR and Symfony's YAML — but no helpful installer. The chapter continues with explication of Drush command invocation, arguments, options, aliases, and context. The only apparent blemish is that the variable name "site-name" (page 14) should instead read "site_name."

After this introductory material, one would expect the next chapter or so to explain and illustrate the details of Drush commands frequently used by site developers, such as those for installing, enabling, and updating modules and themes. Instead, the author jumps far ahead to much more advanced topics (more on this below). In the case of the second chapter, the goal is to learn how to synchronize code, database configuration, and content among different server environments, including capturing database configuration settings in files so they can be version controlled in Git. This is arguably worthwhile knowledge, but certainly not what the average reader would expect so early in the book.

Readers attempting to follow and replicate the demonstrations in the book, may become frustrated with the pitfalls in the second chapter — such as the instances where it does not provide all the needed instructions, or they don't match the example code. When readers starting from scratch encounter the Drush script (page 23), they may be tempted to try it right away on their own test sites, but this would be ill-advised because the first command will fail until the Registry Rebuild command is installed (later in the chapter), and the fourth command will fail if the chosen website does not have the Features module already installed and enabled. When learning about database updates, the reader is instructed to create a new Boolean field, but only later learns that the test website should have contained nodes of the "Basic Page" content type. When readers learn these things the hard way, they must circle back and redo steps or, even worse, try to revert the state of files or the database.

The mymodule custom module found in the downloadable archive does not match what the reader will need on page 30, so she will need to modify mymodule.install to match that listed in the book, and also presumably comment out the last two lines in mymodule.info related to the Features module — but not the first two, because that would result in worse problems later. This initial code should have been included in the downloadable archive. Before running the command drush --verbose updatedb, should she have enabled the mymodule custom module? Apparently so, since the expected output includes "Executing mymodule_update_7100," but when I tried it, the provided module's update hook was not recognized as a database update, using Drush or the admin interface (update.php). On page 32, the reader is told to download and enable the Features module, but that must have been done already because the mymodule module required it earlier. Lastly, the book's preface states that PHP version 5.2 (or higher) would be sufficient, but 5.5 is needed, otherwise a fatal PHP error is generated by the empty() call on line 29 of the "7101" example code.

The third chapter covers the use of Drush for running and monitoring a variety of tasks in a Drupal website, such as updating the database or reindexing the searchable content in Apache Solr. The author begins by briefly describing the uses for the cron utility, and some advantages of executing it from Drush. A technique shown for preventing Drupal from running cron automatically, is to set the cron_safe_threshold variable to 0, export it to code (as a Features module), and then deploy it to the target environments. The author also demonstrates how to use Jenkins in conjunction with Drush to periodically run and monitor cron jobs. As an example of running a task without using cron, a Feeds importer is set up to work with Drush, using a custom module and a Drush command to trigger the Feeds importer. It's not mentioned in the book, but for the importer, in the settings for the node processor, be sure to assign the bundle, otherwise there will be EntityMalformedException errors; also, map the essential feed and node elements, otherwise the nodes created will be empty.

The book then explores a number of topics that are somewhat related to one another: how to use Drush and the Drupal Batch API to run time-consuming tasks so as to avoid PHP and database limits of memory and time; how to run PHP code after Drupal has been bootstrapped; how to best log messages using the drush_log() function; how to capture Drush output in a file; how to implement your own logging mechanism by overriding the Drush default logging function; and how to run Drush commands in the background. Despite the complexity of the processing implemented in this chapter, readers should encounter few problems trying it out. For the drush php-eval commands, Windows command line users will need to replace the single quotes with double quotes. In the section titled "The php-script command," two of the three "php-eval" terms should instead read "php-script" (page 65).

Debugging and error handling are addressed in detail in the fourth chapter: how to validate user input values and Drush command line options prior to passing them to a command's callback; how to define custom validation within a command; how to discover all of the available hooks for any given Drush command; utilizing the Devel module, how to discover all of the Drupal modules that use a given hook, and how to find the location of a given function or class method. In the midst of all this, readers get a detailed tour of the steps that Drush executes when bootstrapping Drupal. Readers should note that, as with the second chapter, some of the code in the downloadable archive does not match the initial code presented in the text, but rather its final state. As readers may have been seen in earlier chapters, the "-- verbose" versions of the Drush commands can produce a lot more informational output than what is presented in the text, including the MySQL commands (that may be a consequence of, in this case, the Windows command line). In the case of drush --debug testhooks, the output is remarkably different, but at least all of the commands are executed.

The penultimate chapter explores techniques for leveraging Drush to better manage Drupal websites on local and remote servers, utilizing site aliases. Developers will undoubtedly be intrigued if not thrilled with the possibilities of being able to execute Drush, Linux, and MySQL commands within remote environments from the local command line. The only questionable aspect is that in the first chapter it is claimed that one "does not even have to open an SSH connection" to perform these feats of digital derring-do, and yet all of them presented in this chapter seem to depend upon an SSH connection — if not explicitly on the command line, then at least established and used in the background by Drush. Nonetheless, the potential power of using Drush in this manner is clearly significant for Drupal site builders and maintainers, and thus the author wisely shows how to avoid inadvertently corrupting the files or database of a target installation.

The final chapter blends and builds upon most if not all of the topics addressed in the earlier chapters, to show how Drush can be used to set up an effective development workflow for teams building Drupal websites. To this end, the author demonstrates how to move Drush commands out of a project's web document root, and how to use Drupal Boilerplate to achieve this and more. The instructions employ wget to download Boilerplate, but other readers as well may encounter an error of wget not being able to verify github.com's certificate. Readers learn how to use Jenkins to synchronize the Drupal files and databases in disparate environments, how to use Drush commands to improve database synchronization and sanitization, and how to prevent inadvertently emailing production addresses.

Like seemingly any Packt Publishing book, this one has plenty of errata relative to its length: "OSX" (page 9; should read "OS X"), "an input data" (page 14; should read "an input datum"), "inform [Drush] where" (page 19), "Dated" (page 21; should read "It is dated"), "sites/all/drush/command[s]" (page 28), "type Page" (page 29; should read "type Basic Page"), "PHP.ini" (page 34; should read "php.ini"), "cover [the] Queue API" (page 58), "context" (page 66; probably should read "content"), "run[ning]" (page 66), "straight brackets" (page 68; just "brackets"), "thanks to [']allow-additional-options'" (page 83), "require [the] minimum" (page 94), "a valid Drupal's root directory" (page 94; no "'s"), "point [to] our local Drupal project" (page 117), "logged as message" (page 120), "our the $HOME path" (page 139), "password;." (page 149), and "offers [a] hook" (ditto). Some of the phrasing is odd, e.g., "output can be logged in to" (page 34), "tasks running at cron" (page 52), and "equals to 1" (page 61). Some of the sentences are incomplete, e.g., "Importing configuration into the database." (page 34). Fortunately, none of the narrative is incomprehensible, and it is generally smoother in this edition than in the first.

The structure of this book is more logical than that of its predecessor. As Drupal expert Mike Anello correctly pointed out in his review of the first edition, "the book could have easily been improved by splitting out various sections of chapters into their own stand-alone chapters." The same criticism still holds true for this second edition, particularly the third chapter, though to a much lesser extent overall.

As with most if not all titles offered by Packt Publishing, this book's chapters are lengthened with summaries, none of which serve any useful purpose, since they repeat what was presented just pages earlier, but do not include enough detail to be of any value.

One major problem with the book is that it is billed as a second edition to the earlier user guide, which covered introductory and intermediate topics; yet this second edition does not, and instead is almost entirely devoted to advanced topics. In fact, much of the material is preparatory for the final chapter, on utilizing Drush to improve a team's project workflow. This is not made clear to the prospective buyer. This is truly a new book, and not an update of the first edition. Furthermore, it is more focused on specific uses of Drush.

Whether this book could be recommended to any potential reader, depends upon what that individual is hoping to learn. For anyone who wishes full coverage of the beginner and intermediate topics of Drush, this book would be completely inappropriate, and the individual would be best pointed to the Drush documentation. On the other hand, the book would be much better suited for a Drupal developer looking to improve his or her understanding of using Drush for managing database configuration settings and other topics related to project workflow, particularly in team settings — in which case it could be extremely valuable.

Michael Ross is a freelance web developer and writer.

Submission + - Modern PHP: New Features and Good Practices

Michael Ross writes: Robert, here is the book review meta-data: author: Josh Lockhart pages: 268 publisher: O'Reilly Media rating: 8/10 reviewer: Michael Ross ISBN: 978-1491905012 summary: Solid advice on some state-of-the-art PHP tools and techniques.

In recent years, JavaScript has enjoyed a dramatic renaissance as it has been transformed from a browser scripting tool primarily used for special effects and form validation on web pages, to a substantial client-side programming language. Similarly, on the server side, after years as the target of criticism, the PHP computer programming language is seeing a revival, partly due to the addition of new capabilities, such as namespaces, traits, generators, closures, and components, among other improvements. PHP enthusiasts and detractors alike can learn more about these changes from the book Modern PHP: New Features and Good Practices, authored by Josh Lockhart.

Programmers familiar with the language and its community may recognize the author's name, because he is the creator of PHP The Right Way, a website which he describes as "an easy-to-read, quick reference for PHP popular coding standards, links to authoritative tutorials around the Web and what the contributors consider to be best practices at the present time," in 21 different languages.

Yet rest assured that the book under review is not merely a dead-tree version of the website. Instead, the book covers the more recent advancements within the language, while the website covers best practices and standards. This should be borne in mind, otherwise the reader may be baffled by the absence from the book of certain topics on the website essential to the language, such as SPL, PEAR, and PHPDoc. Moreover, of the topics shared between the book and the website, the information is generally organized quite differently, with more example code in the book.

This title was published on 1 March 2015, under the ISBN 978-1491905012, by O'Reilly Media, who kindly provided me with a review copy. Its material is presented in 268 pages, organized into 13 chapters (The New PHP; Features; Standards; Components; Good Practices; Posting; Provisioning; Tuning; Deployment; Testing; Profiling; HHVM and Hack; Community), which are grouped into three parts (Language Features; Good Practices; Deployment, Testing, and Tuning) — as well as two appendices (Installing PHP; Local Development Environments) and an index. The publisher's page does not offer much of interest. However, all of the example code is available from the book's GitHub repository. There are differences between the GitHub code and what is printed in the book, e.g., a baffling require 'vendor/autoload.php'; in the first example code file. The author claims that the reader does not need to know PHP, but at least "a basic understanding of [] fundamental programming concepts" (page xiv). However, anyone without at least intermediate skills and experience with PHP could conceivably struggle with these more advanced subjects.

The first chapter is only a brief overview of the history of PHP, its current state, and some possible future changes to the language's engine. The real content starts in the second chapter, in which the author gives the reader a fast-paced introduction to his seven favorite major new features in PHP: namespaces, class interfaces, traits, generators, closures, Zend OPcache, and the built-in HTTP server. In some regards, the coverage is a bit too fast-paced, as some topics and questions likely in the reader's mind are not addressed — for instance, namespace case-sensitivity and techniques for ensuring that a chosen namespace is globally unique (page 9). For each topic, its purpose and advantages are explained, and sometimes illustrated with code examples, although none are extensive.

The second part of the book opens with a chapter on some of the new standards in the PHP ecosystem that are intended to move the common development process from a reliance upon one isolated framework, with an idiosyncratic coding style, to distributed components that can interoperate through the use of interfaces, industry-wide coding standards, and the use of autoloaders for finding and loading classes, interfaces, and traits at runtime. Components are covered in more detail in the subsequent chapter, as is Composer, for installing components and managing dependencies. The fifth chapter is a lengthy but information-packed exposition of numerous best practices regarding input data sanitization, password handling, dates and times, and safe database queries, among other topics. Some of the advice can be found in other PHP books and online, but all of this is neatly explained, updated with the newer PHP versions, and worthwhile as a refresher.

Deployment, testing, and tuning are the broad subject areas of the third and final part of the book. The author discusses the options for hosting your PHP applications, as well as provisioning any self-managed web server and tuning a server for optimal performance. All of the instructions assume you are using Linux and nginx, and thus would be of less value to those using Windows or Apache, for instance. The material on application deployment is relatively brief, and focuses on use of the Capistrano tool. Testing is often neglected in real-world projects, but certainly not in this book, as the author explains unit and functional testing, illustrated through the use of PHPUnit. This is followed by information on how to use a development or production profiler to analyze the performance of your application, with detailed coverage of Xdebug and XHProf, among other tools. The next two chapters dive into topics related to the (possible) future of PHP — specifically, Facebook's HHVM PHP interpreter and their Hack derivative language. The final chapter briefly discusses the PHP community. The two appendices explain how to install PHP on Linux or OS X for commandline use, and how to set up a local development environment. The author mentions a free edition of Zend Server, but the vendor page mentions no such pricing.

Despite its technical subject matter, this book is not a difficult read. The author's writing style is usually light and friendly, especially in the preface. In a few places, the phrasing is a bit too terse, which might prove momentarily confusing to some readers, e.g., "Function and constant aliases work the same as [those of] classes" (page 11). The text has some errata (aside from the two, as of this writing, already reported): "curl" (pages 15, 220, and 222; should read "cURL"), "a an argument" (page 33), "Prepared statement [to] fetch" (pages 99 and 100), "with [the] php://filter strategy" (page 110), "2 Gb" (page 129; should read "2 GB"), "the the" (page 154), "path to a the code" (page 176), and "Wordpress" (page 190; should read "WordPress").

One weakness with the book is that for several of the topics — including some critical ones — there is not enough detailed information provided that would allow one to begin immediately applying that technique or resource to one's own coding, but instead just enough information to whet one's appetite to learn more (presumably from another book or a website). Secondly, some of the narrative — particularly near the end of the book, when discussing various tools — would be of less value to anyone not developing analytics environment. Beware that some of the tools require numerous dependencies. For instance, do you have Composer, Git, MongoDB, and its PHP extension installed? If not, then you won't be using XHGUI. Also, some of the installation and configuration steps are quite lengthy, with no details provided for troubleshooting issues that might arise. Lastly, despite the promise that any reader with only basic programming knowledge will be able to fully understand the book, such a reader would likely find much of its contents mystifying without further preparation from other sources.

Nonetheless, the book has much to offer, despite its slender size. Numerous resources are recommended — most if not all apparently vetted by the author, who clearly has considerable experience in this arena. Some valuable techniques are presented, such as those instances in the text where the author shows how to use iteration on large data sets to minimize memory usage. In addition, the example code demonstrates that the author has made the effort to produce quality code that can serve as a model to others. Modern PHP does a fine job overall of explaining and advocating the newer capabilities of PHP that would attract developers to choose the language for building state-of-the-art websites and web applications.

Michael Ross is a freelance web developer and writer.
Book Reviews

Submission + - Mobile HTML5

Michael Ross writes:

Robert, here is the book review meta-data: author: Estelle Weyl pages: 480 publisher: O'Reilly Media rating: 8/10 reviewer: Michael Ross ISBN: 978-1449311414 summary: An extensive tutorial and reference on HTML5 and CSS3.

Web designers and developers nowadays are familiar with the critical decision they face each time before building an application intended for mobile devices: whether to target a particular device operating system (e.g., iOS) and create the app using the language dictated by the OS (e.g., Objective-C), or try to build an operating system-agnostic app that runs on any device equipped with a modern web browser (primarily using HTML5, CSS3, and JavaScript), or try to do a combination of both (using a library such as PhoneGap). The second option offers many advantages, and is the approach explored in the book Mobile HTML5, authored by Estelle Weyl, an experienced front-end developer.

This title was published on 14 November 2013 under the ISBN 978-1449311414, by O'Reilly Media (who graciously provided me with a review copy). The book's material, spanning 480 pages, is grouped into 14 chapters and an appendix, as well as an introduction in which the author presents the advantages of web apps versus native apps, a brief history of both categories (focusing on iPhone development), and an even briefer overview of the HTML5 APIs that are covered in depth in the chapters that follow. Prospective readers may want to first check the publisher's website, where they will find the table of contents, book details, author biography, and a list of errata (only eight as of this writing). In addition, the example code used in the book is available on the author's site. Oddly, the introduction does not specify the requisite knowledge that readers should possess to get the most out of the book. However, a solid understanding of HTML, CSS, and JavaScript would be most helpful; but prior exposure to HTML5 and CSS3 is unneeded, as is any knowledge of any JavaScript libraries, because the author intentionally eschews them in her presentation.

The first chapter, titled "Setting the Stage to Learn Mobile HTML5, CSS3, and JavaScript APIs," continues the discussion begun in the Introduction — largely focusing on the development and testing tools used throughout the book and needed by the reader if he desires to replicate the work described in the narrative. The author's sharp words against IE 6 will be especially appreciated by those designers and developers who have lost countless hours — from both their work schedules and possibly their lifespans — as a result of the rage-inducing layout quirks and other flaws of that demonic browser. Some readers may be confused by the author's instructions for accessing the developer tools in Google Chrome (View > Developer > Developer Tools); with the traditional menu bar now gone, the steps would be the menu icon > Tools > Developer tools.

The next two chapters provide fast-paced coverage of the HTML5 syntax and the new elements and attributes introduced in this latest version of the standard. There are only a few minor blemishes: The author sometimes backtracks, repeating information noted earlier, but worded somewhat differently. For instance, in the second chapter, readers are presented with the syntax of an HTML element (page 25), which is repeated ten pages later. More noticeably, the reader is told six times that the "title" element is required. In the next chapter, the discussion of the "details" and "summary" elements is quite repetitive. Incidentally, on page 76, the author mentions that the "iframe" element has a new attribute, "srcdoc," whose values should not include double quotes, which should be escaped with the """ entity; more accurately, they should be replaced entirely with that entity. Lastly, the explanation of the "sandbox" attribute values is inadequate; readers will need to consult other sources to understand the full meaning of those allowed values. Nevertheless, HTML authors of all levels of experience should be able to benefit from these two chapters.

Forms are an essential component of any dynamic website, and are covered in great detail in the fourth chapter, which explicates the many new features introduced in HTML5, such as validation and error messaging, which significantly reduce the prior reliance upon JavaScript for such functionality. The author does a fine job of explaining these promising new improvements to form elements. The only weakness is, again, redundant explanations — for instance, in the first three sections: "Attributes of <input>," "<input> Types and Attributes," and "New Values for <input> Type." A glaring example is found on page 96, where the second reader tip is echoed in the paragraph that follows it. Screenshots are provided showing the specialized keyboards displayed on the leading handheld devices for the email, URL, phone, number, search, and datetime input types. The chapter concludes with a discussion of form field validation (including use of the validity state object) and the remaining form-related elements, both new and old.

The next two chapters focus on the APIs introduced with HTML5 that were relatively well-defined at the time the book was written, beginning with those that implement SVG, canvas, audio, and video functionality within a webpage, and concluding with application cache, local storage, SQL database storage, geolocation, Web workers, microdata, and ARIA. Most of the narrative should be clear to the reader, although one problem is that sometimes the example code does not reflect the recommendations in the text. For instance, on page 136, the author notes that SVG image accessibility can be enhanced by using the "aria-label" attribute, and that the height and width need not be specified in the "embed" and "object" elements — and yet the code presented does not adhere to these guidelines. Also, on page 175, the author refers to forking code, but the code in question is not forked to a different project or revision; rather, she means different code is executed depending upon the chosen HTML5 database.

Chapters 7 through 10 focus on CSS3, including its unique selectors, color values, units of measurement, box model properties, gradients, shadows, transitions, and animations. It all begins with a review of CSS basics, including media queries and best practices — which makes this book even more viable as a single source for learning HTML and CSS coding. Media queries are touched upon only briefly, because they are covered in depth in a later chapter. Readers will likely find interesting the discussion of maximizing website performance by balancing the number of HTTP requests, the use of embedded styles, and the use of local storage of previously-downloaded CSS and JavaScript files. Oddly, there is inconsistency in the formatting of the example CSS code — for instance, three different formats on a single page (205). Nonetheless, the explanations are for the most part quite clear, aside from the "p:first-of-type" (on page 215). The many snippets of example markup and CSS clearly illustrate how cascading works, and how one can avoid overuse of IDs (and any use of !"important"). The coverage of pseudo-classes and pseudo-elements is quite thorough, with plenty of examples.

The last four chapters employ many of the topics covered earlier and apply them to responsive web design (RWD). Chapter 11 demonstrates how to use CSS 2 and CSS3 capabilities for building websites and web apps that can work and appear as best as possible on device viewports of any size — including those that have yet to be implemented. The information is valuable, marred only by a lack of CSS code showing how the examples were created (e.g., on page 343), prior to discussing the allowed property names and values, and their shorthand notation. Readers learn how to utilize multiple columns, border images, flexbox, @supports, and responsive images. That last topic is arguably the most unresolved aspect of RWD images, and perhaps that is the reason why the author does not discuss the emerging "srcset" attribute and "picture" element for handling the challenge of serving images whose file sizes are optimal for the device's viewport and connection speed. The last three chapters discuss various design and performance considerations one should bear in mind when developing for mobile devices. Most of the initial narrative is at a high level, while the later chapters get into the details of screen sizes, hardware, testing, battery life, and latency. Incidentally, the "meta" element on page 386 was probably not intended to be struck out. The book concludes with an appendix devoted to CSS selectors and specificity.

As with most technical books of this length, this one contains numerous errata: "on ithe Phone" (page xiii), "Chapters Chapter" (xxii), "a[n] OOCSS" (xxv), "that [the] Sources" (12), "never[-]used" (42), "developers that" (44; should read "developers who"), "spammers last millennium" (47; we wish!), "When [the] favicon" (51), "favico.ico" (ditto), "at [the] site" (ditto), "so [it] has" (66), "on [the] same" (77), "<detail>" (80; should read "<details>"), "Barn[e]s" (80), "])){" (95; should read "]){"), "seperate" (101), "override [the] default appearance" (102), "rangUnderflow" (121), "form control[']s value" (121), "requiredlist" (124, 125), "an list" (124), "pros of cons" (146), "first from" (149; should read "first frame"), "when [the] game" (168), "function [is] initially" (169), and "via [a] banner" (179). At this point, roughly halfway through the book, I stopped recording errata.

Most of the writing is clear and straightforward. However, some of the phrasing is a bit confusing, e.g., "is in the last call" (page 101). Other phrasing may come across as too flippant, e.g., "Duh!" (page 48). Some terms are used much earlier than when explained, e.g., "shadow DOM" (page 100). A few terms are used that can have various meanings depending upon the context, but in this book their intended meanings are not defined and likely would not be obvious to the average reader. For example, in Chapter 3, several times the author refers to the "outline" of a (presumably HTML) document and a "node" that one might create, but does not explain what is meant by those terms in these cases.

Most books that use some sort of example project to illustrate the ideas being presented, will weave it into the narrative when appropriate and/or as much as possible. The example project for this book, CubeeDoo, is mentioned countless times, but apparently not explained in its entirety, nor is discussed the stitching together of the code snippets into a complete application. As a consequence, the example project adds less instructional value to the book than could be expected given the amount of space devoted to it. Arguably, it would have been better to either make full use of the project as a teaching resource, or use a simpler application if the first option would have been overwhelming, or simply exclude it altogether from the text and, optionally, post it online for readers who wish to examine the code on their own.

In terms of the layout and presentation of the text, this book, like so many other O'Reilly Media titles, oftentimes has too little space between adjacent words, making it more difficult to read the text at a rapid pace and to quickly locate individual words known to be present on any given page (such as words found in the index). In some cases, attribute names are chopped off midway and continued on the next line, but without the standard hyphen to indicate word continuation (e.g., "ac / cesskey" on page 30). The same is occasionally done for JavaScript method names (e.g., "se / tAttribute" on page 39). Admittedly, for keywords such as element names and attributes, as well as JavaScript names, adding any hyphen might be even more misleading, as some readers might erroneously conclude that the hyphen is part of the name when not broken over two lines.

The book's primary problem is the repetition of information, not just within each chapter, but oftentimes even on the same page. This is true not only within the main text, but also in the reader tips, which sometimes present new and useful information, but far too often repeat the information found in the paragraph preceding the tip — sometimes an almost-verbatim repeat of the paragraph's last sentence. This is not of great consequence, and may be helpful to readers who miss an important point the first time it is presented. Some of it may be unavoidable, given the overlap among the various topics. But it certainly does add to the (nontrivial) length of the book.

Regardless, these are not overly important flaws. Suffused with the author's honest writing style — as well as her obvious experience and enthusiasm — Mobile HTML5 is a substantial and instructive treatment of the primary new techniques for building mobile-ready websites and web apps.

Michael Ross is a freelance web developer and writer.

Submission + - Getting Started with Drupal Commerce

Michael Ross writes:

Robert, here is the book review meta-data: Getting Started with Drupal Commerce Richard Jones Packt Publishing 24 September 2013 978-1783280230 152 pages 7/10

An online store is one of the most common use cases for a website nowadays. For those web developers and business owners who choose the current version of Drupal as a basis for such an e-commerce project, the canonical solution is Drupal Commerce. There are numerous online resources for learning Commerce, and yet for the longest time no printed book. Now we have Getting Started with Drupal Commerce, written by Richard Jones.

This title was released by Packt Publishing on 24 September 2013, under the ISBN 978-1783280230. (This review is based upon a copy of the book kindly provided by the publisher.) On the book's website, visitors can read information about the book, including its table of contents, errata (none listed, as of this writing), and a sample chapter (the third one, on "Planning Your Store").

At first glance, 152 pages may seem wholly inadequate for explaining how to build an online store using Drupal Commerce. However, the table of contents suggests that, within the book's 10 chapters, the author addresses most of the critical topics: installation of the Commerce project, product catalog and classification, product data, shopping cart functionality, the checkout process, shipping services, taxes, order management, discounts, and coupons. A bonus chapter, "Extending Commerce," is not included in the book itself, but is available as a free download. (Readers should note that the URL provided in the book is incorrect, as it is missing the last underscore.)

Prospective readers do not need to know how to program in PHP or Drupal; however, a working knowledge of Drupal site building through the user interface, would be helpful. Anyone who wishes to follow the steps performed in the book for creating the example Commerce site, must have access to a Drupal 7 installation, with sufficient privileges to install and configure modules and set permissions, as needed.

The first chapter, "Introducing Key Concepts," as the title suggests, introduces the reader to the Drupal Commerce package, its overall capabilities, its submodules, and its dependencies. The module list (on page 6) is missing nine entries. Other than that, the material provides a good sense of what is to come. The first chapter, like all the others in the book, concludes with a brief and utterly useless summary. In this case, it states that the readers now "understand the motivation of the developers," even though that was not discussed in the chapter.

Installing Drupal Commerce is the subject of the next chapter. MySQL is listed as a requisite download, but actually MariaDB, PostgreSQL, and SQLite are equally usable. The author mentions Mac OS X and Windows as possible environments, but neglects Linux. Most of the chapter assumes that the reader has elected to use the Acquia Dev Desktop, and it consequently may prove frustrating to anyone who uses a different distribution to get started, or who installs the needed components individually.

As an e-commerce website is developed and (usually) later modified, the participants discover the value in all of the time and effort invested upfront in planning the information needed to track products, customers, payments, and other facets of the operation. Thus the third chapter is arguably one of the most valuable in the book, and should prompt site designers and developers to ask plenty of questions of their clients.

With Chapter 4, "Products," the author begins describing and illustrating the creation of the example website — in this case, a wholesale coffee and tea store based in the UK. At a critical juncture (page 35), the reader is instructed to enable "Commerce Backoffice (Commerce package)" and "Commerce Backoffice (Product package)," which is odd, since all four Commerce Backoffice submodules are in the "Commerce (contrib)" package, and none have those two exact names. Readers may presume that Commerce Backoffice and Commerce Backoffice Product were intended. It later turns out that "Commerce Backoffice content" was also needed. It is possible that the author was using an earlier version of Commerce that had different names, but that's difficult to ascertain because he apparently does not mention which version of Commerce is used in the book.

Chapters 5 and 6 demonstrate how to set up a shopping cart and configure the checkout process. The material should be comprehensible to the typical reader, and possibly a pleasant relief if his head is still spinning from the terminology soup encountered in the fourth chapter. The author explains how to use PayPal for accepting customer payments, and what permissions to set so that visitors to one's store can check out. Strangely enough, there is no discussion as to what permissions, if any, visitors will need for viewing products and adding them to the shopping cart. This might seem obvious to those experienced with Drupal Commerce, but likely will not be to neophytes.

The next two chapters show how to set up flat rate shipping as an option for one's customers, and how to apply a value added tax to each order, including the use of the Rules module for handling special cases flexibly, such as offering free or discounted shipping when the checkout balance exceeds a certain amount on any order not being shipped internationally. Lastly, readers learn how to set up order tracking.

The last three chapters demonstrate how to apply various tax rates to customer orders, how to manage orders on the back-end (such as setting status codes and viewing payment transactions), and how to define discounts and coupons that can be offered to prospective customers. The 11th chapter, on extending Drupal Commerce, should have been included in the published volume itself, as it certainly would not have pushed the page count beyond a reasonable level.

Throughout the book, almost all of the explanations are clear and straightforward, with the only exceptions being the puzzling reference to a "uid property" (page 10), which is not explained, and the use of several different phrases to describe product display nodes (in the fourth chapter). Unfortunately, all of the material apparently assumes that the reader will encounter no problems in trying to perform the same steps, because no troubleshooting resources are mentioned.

Aside from the aforementioned faulty URL on page 2, this book contains too many errata relative to its size: "out of the box" (page 5; missing three hyphens), "Apache based" (page 13; same problem), a space in the URL (page 15), "than [a] necessity" (16), "to [the] recently" (17), "Specifying [the] language" (25), "to [the] public" (27), "other than helper modules" (35), "Images/" (39; should be lowercase), "fairtrade" and "fair trade" (46 etc.; should read "fair-trade"), "doesn't" (47; should read "isn't"), "top-" (64), "blocks" (67; should read "block"), "rules" (73; should read "rule"), "as [a] page" (76), "as screen" (93), "field_tax_code" (106-107; should read "field_vat_code"), and "cine" (108; movies and Jamaican coffee have the same pricing?).

Like so many other books in the computer field, this one contains other flaws in the writing, such as semicolons used where commas are called for (e.g., page 5), and the mixing of singular and plural terms (e.g., page 28). However, its quality of writing is better than that of the majority of Packt Publishing's offerings.

Most of this book's screenshots are quite helpful, although a few might cause some confusion, mostly in that they do not reflect what the reader will see in her own installation. Consider only a handful of examples: An image field "Progress indicator" is mentioned (page 39), but not evident in any screenshot nor on the "Product image" edit page in my own installation. The screenshot on page 45 does not include the "Description" field that the reader is instructed to create, two pages earlier. A "Product: Tax code" field is shown (page 57), prior to any tax functionality being implemented in the narrative. The checkout web page is missing a field for an e-mail address (page 80). Alert readers will immediately wonder where in Drupal Commerce they would go to modify the billing fields, but that doesn't seem to be covered (but I could be mistaken).

One may level the charge that this book provides only the information needed to create a fairly simple e-commerce website. But that would be missing the point, because this book is not intended as an exhaustive exposition of the subject. Getting Started with Drupal Commerce is a valuable starting point for anyone interested in learning how to build online stores using Drupal 7.

Michael Ross is a freelance web developer and writer.

Submission + - Eloquent JavaScript: A Modern Introduction to Programming

Michael Ross writes: Eloquent JavaScript: A Modern Introduction to Programming Marijn Haverbeke 3 February 2011 978-1593272821 No Starch Press 224 pages A concise and lighthearted tutorial on this popular web programming language. 9/10

Of all the computer programming languages, JavaScript may be enjoying the most unprecedented renaissance ever. Once derided as a toy language suitable only for spawning bothersome popups in browser windows, JavaScript is rapidly developing into a first-choice web technology on both the client side and the server side. One way to get started learning this ubiquitous language is the book Eloquent JavaScript: A Modern Introduction to Programming.

Written by Marijn Haverbeke, the book was published by No Starch Press on 3 February 2011, under the ISBN 978-1593272821. On the publisher's page for the book, visitors will find the table of contents and some reviews. (My thanks to the publisher for a review copy.) The author's book website offers much more, including HTML versions of the book (whose content differ from the print edition), errata (applicable only to the first printing of the paper edition), and an interactive code sandbox where you can run the examples (or at least some of them).

At a slender 224 pages, this volume might at first glance appear inadequate for covering such a sizable and rich language as JavaScript — and yet the table of contents suggests otherwise, with a dozen chapters covering language basics, functions, objects, arrays, error handling, functional programming, object-oriented programming, modularity, regular expressions, web programming, the DOM, browser events, and HTTP requests. In addition, readers may be reminded of how much information Kernighan and Ritchie were able to pack into the 228 pages of the first edition of their classic The C Programming Language.

Following a pleasant introduction, the first three chapters present the basics of JavaScript. In the first one, the author presents the language's fundamental grammar, specifically: values, data types, arithmetic operators, expressions, variables, control statements, the JavaScript environment, and program structure. The material assumes no prior knowledge of computer programming or even data representation.

In the second chapter, the author does a thorough job of explicating all aspects of functions, including definition form and order, variable scope, arguments, the call stack, closure, and other topics. The subsequent chapter addresses an area important to any programming language, namely, data structures — which in JavaScript are of two varieties, objects and arrays. The author illustrates some best practices, such as modularizing code.

Most programming books underemphasize or even completely neglect the critical topic of error handling, and thus it is encouraging to see the author of this book address it, as early as Chapter 4. He focuses on exception handling, and also touches upon the value of unit testing (incorrectly termed "automated testing"). The subsequent chapter describes functional programming, which is not to be confused with procedural programming, but rather refers to combining functions in order to achieve higher levels of abstraction in one's code, thereby reducing its size and better exposing its functionality amidst the syntactical clutter. One apparent technical flaw is the claim that, in HTML documents, the special characters <, >, and & always must be replaced by their entity values, even when surrounded by whitespace characters (page 78). (Incidentally, any book that mentions the KGS Go Server can't be all bad.)

Object orientation is the subject of the sixth chapter, the longest in the book. Despite the author's efforts, this material will likely prove to be the most challenging to readers, given the numerous idiosyncrasies of JavaScript's objects and their built-in methods. The next chapter explores a related topic, modularity, which unfortunately is not supported natively by JavaScript; the author presents some ideas to work around this limitation.

Of all the data processing performed by web sites and apps, a significant portion of it is text manipulation, where the use of regular expressions can be extremely valuable, despite the potential pitfalls. This is tersely covered in Chapter 8, which, in my opinion, should instead be located far earlier in the book, after the discussion on strings. The next chapter is a fast-paced examination of just some of the key aspects of client-side scripting using JavaScript. The only confusing portion is the reference to "the document tag" (page 155), with no explanation as to what that is. The last three chapters continue the discussion of in-browser programming, focusing on the Document Object Model (DOM), browser events, and HTTP requests. Some of the material feels dated, but it is a decent survey of relevant information.

The narrative is well written, aside from the use of long dashes when semicolons are called for and the occasional strange phrasing, such as "two backslashes follow each other" (page 12). Also, the book contains several erratum, most of them a simple mismatch of singular and plural forms: "The example show" (page 11), "executing a statements" (20), "is a special kind of objects" (46), "special type of objects is" (68), "with is em" (89; should read "is em"), "than of an" (90; should read "than an"), "new type of objects" (123), "used as to map" (146), "on [the] current field" (185), and "touched on [in] Chapter 9" (190).

The author wisely makes use of numerous examples, which are of two types: Most if not all of the fundamental concepts are illustrated with pithy examples — particularly in the first half. In Chapters 3, 5, 6, and 11, the author utilizes extended, fictional examples. Some readers may argue that these longer ones are excessively so — especially the terrarium — but there are many nuggets to be found in those pages. In fact, the book overall is largely free of fluff.

In terms of technical information, the book does not attempt to cover all the details of the language itself. Readers will appreciate that the author does not shrink from pointing out the weaknesses in JavaScript, as well as explaining the problems they may cause. One blemish is that many of the small sections of code contain a mixture of complete lines of code as well as standalone expressions (in bold), and usually those expressions are terminated with semicolons, giving them the appearance of lines of code. No doubt some readers will be confused by this convention.

From a production standpoint, the text is quite readable, except for the quite annoying and obvious problem that the font to indicate in-line source code looks almost identical to the non-code text font. There are few diagrams and even fewer screenshots, but that poses no difficulties.

At times this book is even fun to read, partly because of the use of non-silly humor, especially in the two examples of the eccentric (and cat-centric) aunt, and an unsocial reclusive programmer (imagine that).

If you choose to start your JavaScript journey with this book, it can quickly teach you a lot of technical information (relative to its size), and also programming wisdom.

Michael Ross is a freelance web developer and writer.

Submission + - Programming PHP, 3rd Edition

Michael Ross writes: As a hugely popular scripting language with an 18-year history, PHP has been the topic of countless computer language books. One of the most comprehensive offerings has been Programming PHP, published by O'Reilly Media. The first edition appeared in March 2002, and was written by Rasmus Lerdorf (the original developer of PHP) and Kevin Tatroe. A second edition was released in May 2006, and saw the addition of another co-author, Peter MacIntyre. With the many changes to the language during the past seven years, the book has again been updated, to cover all of the major new features made available in version 5 of PHP.

This third edition was published on 22 February 2013, under the ISBN 978-1449392772, with the same three authors at the helm. At a substantial 540 pages, the information is organized into 17 chapters, each focusing on a particular area of the language and its usage. This material precedes an appendix of almost 130 pages, which serves as a reference for all of the language's built-in functions. In fact, not only could this book suffice as a reference guide, it could also serve as a tutorial, because it is accessible to programmers of all levels, including beginners who have never before worked with PHP. The preface notes that the material assumes only "a working knowledge of HTML." However, the example code seems to also assume that the reader is comfortable with fundamental programming concepts, such as conditionals and loops.

To learn more about the book, prospective readers and buyers may wish to visit the publisher's website, where they will find a description of the book, its table of contents, a free copy of its first chapter, and the example code for ten of the chapters. Speaking of formats, the book is available in print and electronic media. (This review is based upon a copy of the print version kindly provided by the publisher.)

The first three chapters explain the bedrock fundamentals of the language, including its lexical structure, data types, variables, expressions, operators, flow-control statements, code inclusion methods, and functions. All of the information appears to be valid, aside from several technical blemishes: In Example 1-1, most of the lines of code are duplicated. Example 1-5, which supposedly creates a PNG file, does not seem to work. The section on constants (page 21) should have mentioned the core predefined constants and also distinguished those from magic ones. The binary literal 0b01100000 is 96, not 1 (page 23). It is claimed that an object is evaluated as false if it contains no values or functions (page 25), and yet: "class C{} assert( new C );." The closure example code (page 29) fails because it includes a function name and no terminating semicolon. The example code in the middle of page 66 contradicts the claim that an inner function "cannot be called from code parsed after the outer function." The example code starting at the end of that page fails because $a in foo() is undefined. Nonetheless, even experienced PHP programmers could pick up knowledge not encountered before, or at least refresh what was learned years ago and since forgotten due to disuse.

The next two chapters explore in detail further essential components of PHP: strings, regular expressions, and arrays. As with the earlier chapters, readers will encounter example code that does not appear to have been tested. For instance, the print_r() output of an object is missing the class name (page 84). On the same page, print_r() and var_dump() of $GLOBALS do indicate "*RECURSION*," but do not loop infinitely or three times, respectively, as claimed. The $record on page 86 is missing its trailing tab character. For these errors and others, it is not clear whether the authors or the technical reviewers are ultimately responsible. Regardless, readers should find useful the tables summarizing regular expression character classes, anchors, quantifiers, and options. On the other hand, the treatment of conditional expressions is sorely in need of examples. Also, readers will be baffled when told that "The preg_match() function takes the same arguments and gives the same return value as the preg_match() function []" (page 112). Lastly, the callback example code is faulty (pages 131, 133, and 141). The sixth chapter, covering object-oriented programming is well-written, aside from the confusing phrase "including it to a different name" (page 160) and the anti-Nietzschean "this will fatal" (page 161).

With Chapter 7, the book shifts gears from the basic underpinnings of PHP to more applied topics, in this case, web techniques — specifically HTTP, global variables, server information, web form processing, sessions, and more. The narrative is quite clear, except when the reader is told that periods in field names are converted to underscores because periods are illegal in PHP variable names (page 178); the connection is not explained. The next chapter looks at server-side data storage, including the topics of PDO, MySQLi, SQLite, and MongoDB. Confusingly, readers are told that the sample SQL database code is available in a file, but they are not told where to find it (http://examples.oreilly.com/0636920012443/).

Chapters 9 through 11 address PHP's support for three specialized file types: graphics, PDF, and XML. The explanations are excellent, and the authors provide numerous examples. The only obvious flaws are in Example 11-1 (page 269), where the

echo

statement is missing the "<?" and two of the lines have mismatched single and double quotes.

The remaining half dozen chapters cover critical aspects of PHP development. The chapter on security does not attempt to be exhaustive, but instead explains the most common attack vectors and how to block them. The chapter on application techniques discusses code libraries, templating, output buffering and compression, error handling, and performance tuning. Any programmer intrigued by the idea of replacing clunky VBA code with PHP, should be interested in Chapter 14, which explores the differences in running PHP on Windows vs. other platforms, with a brief look at manipulating the contents of Microsoft Word and Excel files using PHP. RESTful web services and XML-RPC are the topics of the next chapter, whose only apparent blemish is that json_encode() does not add spaces between the array values (page 339). The penultimate chapter addresses multiple environments, manual debugging, and the use of an IDE. The last chapter briefly covers PHP support for dates and times, and thus should have been located much earlier in the book, with the other material on fundamental concepts.

Overall, this book is quite approachable. Throughout, one will find programming style recommendations, However, as with any technical work of this size, there are passages that could be made more complete or clear. Occasionally the authors will mention something explained only later — e.g., "short echo tag" (page 60) — which can be frustrating to anyone new to a language.

The concepts of PHP being taught are extensively illustrated with example code. Some of it is concise enough so as not to distract from the narrative flow, but far too many examples involve much more code than necessary. This at first glance might seem to be an advantage, but it actually makes it more difficult for the reader to see the parts of the code relevant to the topic at hand. Also, the authors underutilize whitespace in the code, instead jamming tokens and parentheses together.

In a book of this size, we should not be astonished to find some errata: "Wordpress" (page xv), "try and" (same page; should read "try to"), "tick function registered when register_tick_function()" (55; should read "with" not "when"), "eXtensible" (59), "super-global" (67; should read "superglobal"), "display_classes() function" (vs. "function displayClasses()"; 164), "$var" (294 and 295; should read "$value"), "functions of blocks" (323; should read "functions or blocks"), "retried" (337; should read "retrieved"), and "a.k.a." (350; should read "e.g.").

In terms of the production of the book, like most other O'Reilly titles, this one is nicely put together, with readable font. But sometimes words are jammed together so much that lines appear to be a single word, e.g., "codeitselfbutplentifulenoughthatyoucanusethecommentstotellwhat'shappening" (page 17). Also, the publisher should avoid splitting the function names as if they were English words, e.g., "addc" and "slashes()" on separate lines (page 91). The index is missing some obvious entries, e.g., "closures." Many code snippets are missing the "Example" numbers and captions. This may be fine if the authors do not reference those snippets, but makes it problematic for anyone else to reference them.

Even though this is arguably one of the most comprehensive PHP books on the market, it does not cover all aspects of the language. On page 1, readers learn that PHP can be utilized in three major ways — server-side scripting, command-line scripting, and client-side GUI applications; but only the first is covered in the book. The appendix consumes over 120 pages, and comprises information easily available online in the PHP manual's function reference. Those pages could instead have been devoted to at least introducing command-line scripting and GUI applications. In fact, there are two major changes the authors could take in bringing this book much closer to perfection: Firstly, retest all of the code and root out any technical snafus. Secondly, replace the lengthy appendix with full coverage of the topics of command-line scripting and client-side GUI applications.

Regardless, Programming PHP is both a tutorial and a reference resource packed with information and example code. Benefiting from the author's deep expertise in the language and its usage, the book is the most promising single source for anyone who wishes to learn this ubiquitous web scripting language.

Michael Ross is a freelance web developer and writer.

Book Reviews

Submission + - Enyo: Up and Running 1

Michael Ross writes: "Upon hearing the name "Enyo," one may wonder if the speaker is referring to the Greek war goddess, or if it is the name of some Celtic New Age music with a Latin twist. In the world of front-end software development, Enyo is a cross-platform open-source JavaScript framework that can be used to build HTML5 web applications for the desktop and for mobile devices, including those powered by iOS and Android. The project website bills it as "an object-oriented JavaScript application framework emphasizing modularity and encapsulation." Any programmer interested in learning Enyo — or at least exploring what it is capable of — can consult the online documentation and the forums, but a more time-efficient approach might be to read a book focusing on the topic, such as Enyo: Up and Running, written by Roy Sutton, a contributor to the project.

The book was published by O'Reilly Media on 6 February 2013, under the ISBN 978-1449343125. (My thanks to O'Reilly for providing a review copy.) On the publisher's page, visitors can find limited information about the book and its author, some reader reviews, links to purchase the electronic and print versions, and a page for errata (of which there are none, as of this writing). At 74 pages in length, this title comprises seven chapters, plus an appendix explaining how to set up a local development environment for working with Enyo, with a few options to choose from. Thus, the appendix is where most readers should and likely will start. In the preface, the author notes that the book assumes "some familiarity with HTML, CSS, or JavaScript"; that "or" should be an "and," since all three technologies are foundational to Enyo.

The first chapter introduces Enyo by examining a fairly simple web app — one that displays a traffic light on the web page. Naturally, in a black-and-white book such as this, the red/yellow/green colors are all in grayscale. Much more importantly, of the seven jsFiddle-hosted code examples provided in the chapter, the first five do not work (as of this writing), apparently because in each case there exists in the code some sort of control character, displayed as a red dot. (In the third example, the dot character is in the JavaScript and not the HTML.) Readers should delete that character and click the "Run" button, to see the intended results. The last two examples work only because the dot character comes after the closing </script> tag. It is baffling how these flaws could have gone undetected by the production staff and technical reviewers.

The material seems to raise as many questions as it answers. Assuming that the code printed in the book works (no downloadable code archive is offered), readers will probably be left pondering questions such as: Is create: function() some sort of constructor? Why isn't a new color passed through the call this.colorChanged()? Why is oldValue apparently not used? Where is setColor() defined? While it is a good idea to entice the reader to try a new technology by showing its capabilities, if that reader is expected to understand the example code presented, then it should be fully explained; otherwise, it should not be presented. As an alternative, the author could have limited the discussion to what functionality Enyo provides to the programmer, without listing source code in print or on jsFiddle. This would have provided the reader with greater motivation to invest the time and effort in learning what can be a challenging subject.

As a result of these early problems, this first chapter does not get the book off to a promising start. The second chapter, "Core Concepts," is perhaps the one that should have begun the book, because it describes many of the core ideas critical to Enyo: kinds, encapsulation, published properties, events, signals, inheritance, constructors, and statics. However, the pace is too fast for beginners, and more examples are needed to explain the concepts, step-by-step. By the bottom of page 11, countless readers will likely be bewildered with the terse discussion of getter and setter functions, "changed" functions, construction, and passed values (which are properties or not). Also, readers will again encounter the aforesaid problem of the red dot character breaking the example code on jsFiddle. (Further instances in the book will not be documented here.) The third chapter continues the discussion, focusing on components, menu and form controls, and functions, as well as some components for animation and making web requests. All of the information looks correct. The only puzzling aspect is why break tags are used (on page 22) instead of a CSS display: block; declaration.

User interface is addressed in the next two chapters, the first of which presents layout components commonly needed for Enyo apps — scrollers, repeaters, fittables, lists, and panels. The second one explores CSS styling of an Enyo app, performance considerations of apps on handheld devices, debugging, common mistakes, jsFiddle, internationalization, and localization. With these chapters, the narrative in the book becomes noticeably more comprehensible.

The penultimate chapter — essentially comprising two pages — delineates some options that the Enyo developer has for deploying a newly-built app to any one of the supported platforms. This chapter, like all the earlier ones, ends with a summary that is so brief, and applicable to so few pages, that each one seems pointless. Why do publishers feel obligated to include these useless chapter summaries in almost every technical book? The final chapter is a one-page conclusion, in which the author encourages readers to learn more and become involved in the Enyo community.

This book is more of an introduction, although no reason is provided as to why it was not instead made a more extensive treatment of the subject. Upon completing the book, the average reader will probably conclude that she did not absorb enough knowledge of the Enyo core to begin immediately developing apps using this framework, and the best course of action might be to start over again on page 1, or perhaps seek out a second source, before optionally returning to this one for a second run-through. The material could have been structured so all information is presented sequentially — so the reader does not encounter concepts yet unseen — with more step-by-step explanations.

Rather than presenting the reader with code snippets that have no relation to one another, it would have been much more interesting and motivating if the author had devised and explained code that incrementally builds into a nontrivial app. Furthermore, the example source code should have been made available on the publisher's website, so readers could avoid typing it from the text or extracting it from jsFiddle if they wished to try it in their local development environments.

In terms of typography, the font size of this book is a bit too small, especially for extended reading, and for people with subpar vision. This is even more true for the code snippets, which are in an even smaller font. In many of the lines of prose, the words are too close to one another — a problem exhibited in a few other recent O'Reilly titles. Did the production team feel it necessary to further compress a 74-page book?! In fact, proper names, such as those of components, are oftentimes broken between two lines in the text — sometimes nonsensically, e.g., "FittableR" followed by "owsLayout" (page 32). The book contains several errata: "This is [not] to say" (page viii), "such as [a] local installation" (viii), "url" (27), "we might modify add" (34), "woud" (35), "one [of] the most" (35), and "allow you [to] easily debug" (56). For such a slender volume, the production quality seems to have received less attention than it deserved.

Overall, this offering does not reach O'Reilly's usual high standards. It's a shame, because it seems like such a promising topic — one that could be more thoroughly explored in a larger volume. Perhaps this feedback, and that of other readers, could be folded into a second edition. This is a real possibility, given that the author notes in his conclusion that he considers the book an active project, and intends to keep it up-to-date with the changes to Enyo itself. In the meantime, this is a promising start that can give readers a taste of Enyo's potential for building modern web apps for desktop and mobile platforms.

Michael Ross is a freelance web developer and writer."
Book Reviews

Submission + - The Book of GIMP

Michael Ross writes: "Web designers, graphics artists, and others who create and edit digital images, have a number of commercial image-manipulation packages from which they can choose — such as Adobe Photoshop and Adobe Fireworks (originally developed by Macromedia). Yet there are also many alternatives in the open-source world, the most well-known being GNU Image Manipulation Program. GIMP is available for all major operating systems, and supports all commonly-used image formats. This powerful application is loaded with features, including plug-ins and scripting. Yet detractors criticize it as being complicated (as if Photoshop is intuitively obvious). Admittedly, anyone hoping to learn it could benefit from a comprehensive guide, such as The Book of GIMP.

Authored by Olivier Lecarme and Karine Delvare, The Book of GIMP: A Complete Guide to Nearly Everything was published by No Starch Press on 22 January 2013, with the ISBN 978-1593273835. The publisher's page offers minimal information on the book and its authors, as well as a skimpy table of contents, and a free sample chapter (the fifth one, on composite photography). Lecarme has a companion website where visitors will find additional resources, including bonus filters, a forum (albeit almost empty), and a selection of the example images used in the book.

This title's 676 pages are organized into 22 chapters and six appendices. The first eight chapters compose "Part I — Learning GIMP"; the remaining chapters compose "Part II — Reference"; and the appendices compose the third part. In a brief but pleasant introduction, the authors encourage readers to follow along by installing GIMP on a local machine. Installation instructions can be found in Appendix E (which arguably should be the first appendix, to get readers started with a local installation). The book is based upon the most recent stable version of GIMP, namely 2.8, which reportedly introduced significant improvements over earlier versions.

As one might expect, the first chapter introduces the basics of the GIMP user interface, explaining how to find and open images, use the menu system in the main image dock, and perform basic editing operations, such as resizing and cropping. It also presents some essential concepts in GIMP — filters, layers, and drawing tools — and then discusses the use of a tablet in conjunction with GIMP. The next six chapters each focus on a major category of image work: photo retouching, drawing and illustration, logos and textures, composite photography, animation, and image preprocessing. The last chapter in the group covers utilizing GIMP for crafting the visual design of a website. The only problem I found in the narrative is the inconsistency in terminology, primarily the references to something as a "dock" on some occasions, and other times as a "window"; also, the "multi-dialog window" (page 4) is later called the "multi-docks window" (page 18). Nonetheless, the prose is straightforward and concise; there is a lot of information contained in each section. Consequently, anyone reading these tutorial chapters should take them at a modest pace, and frequently compare the authors' narrative and one's understanding of it with the screenshots and/or one's own results if following along (a practice I strongly recommend for this particular book, so one will better internalize the broad ideas as well as the details).

Each chapter concludes with a set of exercises, whose questions tend to be much more open-ended and difficult than those normally found in technical books. In fact, readers may be frustrated how some of the exercises challenge one to perform task completely unmentioned in the corresponding chapter. For instance, the very first one in the book, Exercise 1.1 (page 24), asks the reader to build a new dock with dialogs, even though at no point in the chapter was the reader told how to do anything remotely like this. Appendix B contains tips for a minority of the exercises.

The bulk of the book, "Part II — Reference," offers almost 400 pages of details on every aspect of GIMP: the user interface, its displays, layers, colors, selections, masks, drawing tools, transformation tools, filters, animation tools, scanning and printing images, image formats, scripts and plug-ins, and other methods of customizing the application — with each chapter starting with the basics. All of the information is terrific, but the thoughtful reader may wonder why the book begins with advanced topics — such as photo retouching, composite photography, animation, and website design — and later presents the detailed explanations of all the aforementioned aspects of using GIMP. It seems to me that it would have been better to present the Part II chapters first, and then present the advanced topics currently in Part I, except for what is now Chapter 1 ("Getting Started"), which would still be a fine way to begin the explication.

The third and final part contains half a dozen appendices, the first of which is a fascinating exploration of the science of human vision and the three main models of digital color representation. As noted earlier, the second appendix contains tips and hints for some of the chapter exercises. The third appendix is brief, but contains a wealth of online resources for anyone who would like to learn more about GIMP and its community. The next appendix contains a list of frequently asked questions and their answers, and is well worth reading. The fifth chapter explains how to install GIMP on computers running GNU/Linux, Unix, various Linux distros, Windows, and Mac OS X. The final appendix addresses batch processing of images, including the use of ImageMagick.

The production quality of this book is excellent (judging by the print copy kindly provided to me by No Starch Press for review). It was a smart choice on the part of the authors to request full-color images on every page, and the publisher's decision to do so, given the book's visual subject — even though it resulted in a heavier product (3.4 pounds).

Naturally, as a book discussing an image editor, this one makes extensive use of example photos and other images, which are extremely helpful to the reader. Only a few problems were evident; for instance, Figures 1.24 and 1.25 are so small that the cropping pointers are almost invisible. In some cases the descriptions or screenshots do not match what I saw when following along; for instance, on page 3, the author states that the three startup windows (Toolbox, Image, and multi-dialog) by default occupy the full width of the screen, which contradicts the screenshot in Figure 1.1, which shows the Image window at partial width.

The writing is generally clear and easy to follow, even though some of the phrasing is odd (e.g., "source text" to mean "source code"), perhaps because both authors are French. That could also account for the errata — for instance, "on [the] left" (page 15) and "its there" (page 22) — of which there were remarkably few for a book of this length.

If any reader is looking for a free and full-featured image-editing program, then by all means consider GIMP, as well as this outstanding tutorial and reference book.

Michael J. Ross is a freelance web developer and writer."
Book Reviews

Submission + - Sams Teach Yourself Node.js in 24 Hours

Michael Ross writes: "Since its introduction in 1994, JavaScript has largely been utilized within web browsers, which limited JavaScript programmers to client-side development. Yet with the recent introduction of Node.js, those programmers can leverage their skills and experience for server-side efforts. Node.js is an event-based framework for creating network applications — particularly those for the Web. Anyone interested in learning this relatively new technology, can begin with one of numerous resources, including Sams Teach Yourself Node.js in 24 Hours.

This book, authored by George Ornbo, was released by Sams Publishing on 15 September 2012, under the ISBN 978-0672335952. The recent publication date is promising, because Node.js is evolving rapidly, thus gradually obsoleting books written not that long ago. On the publisher's page, visitors will find a brief description of Ornbo's book, a few customer reviews, the table of contents, a sample chapter (the 14th, "A Streaming Twitter Client"), and links to purchase the print and electronic versions of the book. There is also a link to the companion site, which offers some of the same content as Pearson's page, but also has a link to download an archive file containing all the example code, nicely organized.

The book's material spans 464 pages, and is organized (shoehorned) into 24 "hours" (chapters), grouped into six parts. The first two chapters in "Getting Started" explain how the reader can download Node.js, create a "hello world" web server program, install new modules using npm (Node Packaged Modules), search for modules, locate documentation on them, and indicate module dependencies for an application. Unfortunately, the blocks of source code presented in the first examples (Listing 1.1 and Figure 2.2) are not explained in the narrative (until the fifth chapter) or even commented. Readers would likely appreciate some clues as to the nature of http.createServer, req, res, the "underscore" module, etc. — especially at the beginning of their journey. If readers are not expected to understand these details at this point, then they should be told so, to avoid any concerns that such an understanding is assumed in the subsequent chapters. The author does not explain where Node.js is installed or what changes it makes to the terminal's default path variable. On page 18, the term "project folder" is unclear: should the "underscore" module end up in hour02/example01/node_modules, or nodejs/node_modules, or nodejs/node_modules/npm/node_modules? Only later is this (partially) answered.

Chapter 3 demonstrates the complexity that arises from concurrent input/output in networked applications. This material should arguably have been presented at the beginning of the book, to better establish the purpose of Node.js, and the value to the reader of studying it. The next chapter summarizes jQuery and JavaScript callbacks, and then provides a helpful discussion of how Node.js uses the latter. The author contends that the asynchronous paradigm of Node.js is unsuitable for long-running processes, but does not explain why this is true, which would have provided some substantiation for the claim.

The second part of the book, "Basic Websites With Node.js," encompasses four more chapters. The first one discusses how to: create a simple server (using the core HTTP module), examine the response headers (generated for web pages, in different browsers and on the Linux command line), execute 301 redirects, respond to different types of requests (using the URL module), and create a simple client. Oddly, the author does not explain or even mention the sizable JSON output — the first line of which is "{ domain: null," — displayed in the reader's server terminal when the web page pointing to that server is refreshed or when the "curl -I" command is run. The next two chapters cover how to build websites using the Express framework, and are likely the first point where the reader will see some of the real-world complexity of Node.js. The eighth chapter explains how to persist data between calls to the application, including files, environment variables, and MongoDB.

Debugging, testing, and deploying are all critical topics for any application development, and are covered in the third part of the book. The author illustrates three methods of debugging: STDIO, a core module, is a lightweight method for debugging Node.js code; it allows one to output messages to the console, check the value of any variable or literal, and track function calls and responses from third-party services. Node.js provides access to the more powerful debugger of V8 (the Google Chrome JavaScript engine), which supports breakpoints and code stepping. Node Inspector, compatible with WebKit-based browsers, provides all of the above functionality, and more. The next two chapters present several modules that ease the important process of creating full-coverage tests, and demonstrate how to deploy applications to any one of three Node.js-capable cloud hosting providers (Heroku, Cloud Foundry, and Nodester).

Having covered the basics of Node.js, the author begins the fourth part of his book with two chapters that show how to use Socket.IO, WebSockets, and Express to build real-time web applications. These techniques are illustrated in the development of a chat server as well as a nickname management and messaging system. The aforementioned sample chapter extends these techniques further in working with the Twitter API to consume its real-time data, push it to the browser, and show results in a dynamic graph. This section is wrapped up with coverage primarily of JSON — specifically, how to create, consume, and send JSON-structured data.

APIs were addressed briefly in the previous section, but are explored much more deeply in the subsequent five chapters. Readers may initially conclude that the discussion of processes is elementary, but the author then shows how one could utilize that knowledge to interact with Node.js scripts, including detecting script exits and errors, sending signals and arguments to a script, generating child processes if needed, and sending messages among them. In the 18th chapter, the author goes into greater detail about Node.js's Events module, best practices, and how to generate event listeners dynamically. The buffer API may be low-level, but it is essential for storing raw binary data, as opposed to the Unicode-encoded strings that JavaScript uses within a browser. The Buffer and Stream modules are presented with plenty of helpful examples.

The last part of the book addresses miscellaneous topics, starting with CoffeeScript (a JavaScript precompiler). While CoffeeScript affords numerous benefits, it is not clear why it would deserve an entire chapter in a book dedicated to Node.js. In the next chapter, readers learn how to verify their Node.js code, add command-line executables, and then package it all up into portable modules that can be contributed to the npm registry or GitHub. The last two chapters explain how to create and configure middleware using the Connect module, and how to use Backbone.js (a front-end JavaScript framework) in conjunction with Node.js to build browser-based web applications.

Each chapter concludes with a summary (invariably a waste of space), a Q&A section, a workshop comprising quiz questions (with the answers presented immediately below it, for almost instant spoiling), and several exercises for the reader.The index at the end is missing several of the important topics discussed in the text.

The book contains many errata: "EBay" (page 1; should read "eBay"), "OSX" (page 9; presumably Mac OS X), "yaml" (page 15; should read "YAML"), "irc" (19), "led to [a] great deal" (27), "to solve Concurrency" (37), "process" (54; should read "processes"), "try and" (55; should read "try to"), "This goal" (56; should read "The goal"), "how [a] class" (56), "You will [see] the" (62), "status of [a] web server" (70), "javascripts" (77), and "then [the] name" (87). At this point, less than 20 percent into the book, it was clear that the copyeditors had done a sloppy job, so I stopped recording these flaws that should have been caught. Those first four errata suggest that "textese" is even pervading the world of technical publishing. (Strangely, there does not appear to be a place on the publisher's website for reporting errata.)

The production team should have been looking for places to cut down on the heft of the print edition. The "Try It Yourself " sections sometimes duplicate what is found in the regular text nearby — especially in the third and fourth chapters. For instance, three sets of HTML markup are repeated, as well as the surrounding discussion (pages 42 through 47).

In general, the text does not appear to have been carefully scrutinized by technical reviewers and copyeditors. Occasionally the reader is given critical information later than would be optimal, e.g., the "Watch Out" warning on page 18, provided after the reader installs a module. The writing style is noticeably awkward in countless places in the book, including several run-on sentences. (Technical authors should not be bashful in using commas when doing so would help readability.) Also, the text is littered with too many exclamation marks — as if that is going to make any narrative more exciting.

In terms of the production quality of the book, a lay-flat binding would have made it much easier to read when using both hands on the keyboard. Also, in my review copy (kindly provided by the publisher), a disappointingly large number of the pages had small black splotches of ink; fortunately, none made the text unreadable.

On the other hand, Node.js is certainly not a simple subject area, and this book is able to convey a lot of information about it. This book's forte is the extensive use of example code to illustrate the concepts being presented. Incidentally, kudos to the author for inviting the reader to contribute to the Node.js community, such as adding new modules to GitHub or updating the documentation of existing modules. Overall, readers new to Node.js would certainly benefit from working their way through this volume.

Michael J. Ross is a freelance web developer and writer."
Books

Submission + - Drush User's Guide

Michael Ross writes: "With the advent of graphical user interfaces (GUIs) decades ago, most of the commercially-available software transitioned from command-line usage to point-and-click interfaces, with the majority of these applications completely phasing out all command-line capabilities, or never implementing them in the first place. But for programmers — most of whom are comfortable working on the command line — performing administrative actions within a GUI can become tedious and time-consuming, and there is a growing movement toward adding command-line support back to software development applications. An example of this is Drush, which is a command-line interface for the Drupal content management system.

Drush, whose name is derived from "Drupal shell," was originally developed six years ago, and is seeing a resurgence within the Drupal community. However, what appears to be the primary information resource for Drush, the community documentation, currently has a status of "incomplete." Fortunately, there is now a book available that provides more extensive coverage, Drush User's Guide, authored by Requena Juan Pablo Novillo ("juampy"). The book was released by Packt Publishing on 10 April 2012, under the ISBN 978-1849517980. The publisher's page offers descriptions of the book, its table of contents, a brief author biography, the known errata, the example code used in the book, and a free sample chapter (the third one, "Customizing Drush"). This review is based upon a print copy kindly furnished by the publisher; an e-book version is also available.

The book comprises 125 pages, mostly grouped into four chapters, which cover how to install, use, customize, and extend Drush. The preface briefly summarizes those chapters, the software needed to use Drush, the target audience of the book, the styling conventions used in the text, and various publisher information. The author states that "Apache 2.0 or higher" is required to use Drush (page 2), but the project's README.txt does not mention this, and Drupal 7 itself runs fine on Apache 1.3; so this requirement is unclear. He also states that "Drush 4 does not support Windows" (page 13); Windows users are instructed to use Drush 5. This seems questionable, since a quick test revealed that Drush 4.5 runs on a Windows XP machine. Admittedly, it always elicits a warning: "Drush 4.x has significant limitations on Windows; it is not advisable to use on that platform. Substantial progress has been made towards supporing [sic] Windows on the 5.x branch; please upgrade."

The first chapter of the Drush User's Guide naturally begins with instructions on how to install Drush on Linux, Mac, and Windows systems. The book's examples use Drush 4.5, even though 5.1 was available at the time of the book's publication, and 5.0 was available a month earlier. Version 4.5 was the last 4.x release, and was probably the latest stable release when the book was being finalized. Throughout the book, all Windows instructions are specific to Windows 7, so any XP straggler will need to modify them as needed. In the "Manual installation" section, the subheads are almost identical in font size to the higher-level subheads, forcing the reader to check the table of contents hierarchy just to see where the manual installation instructions end. But the main problem is that the reader is not given recommendations as to which optional features should or should not be chosen. For instance, if you already have PHP installed on your system, should you decline to have the Drush installer try to add the "Php [sic] Required Runtime," even though it is enabled by default?

The author then shows how to set up a Drush-specific PHP configuration file, in order to bypass potential problems, such as memory limitations in the default configuration file. In the rest of the chapter, he demonstrates how to perform Drush commands (in general), define arguments and options for those commands, create command aliases, and specify which Drupal website any Drush command is supposed to operate upon.

In the second chapter, "Executing Drush Commands," the author shows the reader how to perform a fresh installation of Drupal 7 — including creation of the database and its tables — with just two commands. He introduces the music festival website that will be used throughout the rest of the book for demonstration purposes. At this point, some readers may hit a stumbling block: The "--drupal-project-rename" option used in the text fails on Windows machines (this is a known issue). Presumably the author did not test his suggested commands in a Windows environment. The bulk of the chapter is devoted to introducing numerous Drush commands, including those used to get and set variables, install modules, administer users, back up the database, and many more.

The author notes that "Drush is highly configurable," and in the third chapter he shows the reader how to create custom commands, include their help information in the output of the command "drush help," extend existing commands, run custom PHP scripts, and define site aliases. Readers new to Drupal may find these topics fairly advanced, as they necessitate familiarity with command namespaces, as well as Drupal's hook system, callbacks, and database API. Defining remote site aliases involves SSH and public keys. However, given the flexibility and power of custom Drush functionality, it is arguably worthwhile to make the effort to learn how to do it properly. At the end of the chapter, the reader learns how to use and configure the Drush command-line interface.

The fourth and final chapter, "Extending Drush," discusses how to utilize some of the modules that are integrated with Drush — specifically, Backup and Migrate, Devel, Features, Views, and Module Builder. The chapter concludes with a section on Drush Make, which packages the module information of a Drupal website so it can be re-created using Drush easily.

As with all of the Packt Publishing titles that I have reviewed, this one has a high number of errata relative to the total page count, aside from the seven already reported online (as of this writing): "command line interface" (page 1; "command line" should be hyphenated when used as an adjective), "book title through the subject" (same page; should be "book title in the subject"), "Clear cache" (page 7; should be "Clear all caches"), "follow [the] instructions" (page 13), "close [it] and open [it] again" (page 18), "try and" (page 21; should be "try to"), "change version by something" ("by" should be "to"), "parenthesis" (page 23, twice; should be "parentheses"), "within [the] sites subdirectory" (page 25), "execute commands towards" (page 26; "towards" should be "on"), "MySql's" (page 28; should be "MySQL database's"), "provided with it" (should be "provided it with"), "that resolves" (page 29; should be "resolves"), "First, of all" (page 33), "anoying" (page 48), "Imagine, that" (page 52), "lists [the] latest messages" (page 55), and "altering existing" (page 57; should be "alter existing"). At this point, not yet halfway through the book, I stopped recording errata. The Packt Publishing copyeditors should have spotted and fixed these obvious errors.

Although the author's meaning is invariably clear enough, the writing style is awkward in many places. For instance, "replace by" (page 4) should instead be "replace with," "take the chance to review" (page 41) should be "take the opportunity to review," and "of the flow" (page 55) should be "in the flow." The term "at" is used to indicate "in" a file — e.g., "at the Drush README.txt" (page 9); the same is true for MySQL tables — e.g., "stored at the variable table" (page 30). In addition, countless passages in the text would have benefited from a comma. Conversely, there are some extraneous commas (e.g., on page 43).

Yet the main flaw of the book is the neglect for readers who are using the Windows operating system for building and administering Drupal websites. The aforesaid "--drupal-project-rename" bug likely would have been caught had the Drush pm-download command been tested on a Windows computer. Another example is on page 48, where it is assumed that the command "firefox" will work as a link to the browser's executable on the reader's computer. Also, the ".drush" folder is critical for creating site aliases and other configuration settings; but where will the Windows user find this folder? This Linux partiality could result in Windows readers encountering — and possibly being frustrated by — confusing technical problems.

Nonetheless, the author does a fine job of explaining how to utilize the many Drush commands presented, as well as many of their arguments and options — oftentimes pointing out differences in their usage for Drupal 6 versus Drupal 7. Any Drupal developer interested in learning how to harness the power of a command-line interface for building and administering websites, should find Drush User's Guide a worthwhile tutorial.

Michael J. Ross is a freelance web developer and writer."
Book Reviews

Submission + - Drupal for Designers

Michael Ross writes: "Of all the open source content management systems used for building websites, Drupal has a reputation for being one of the most flexible and powerful available, but not the easiest for web designers to use. Drupal version 7 has made some strides in alleviating those flaws, but there is still much progress to be made. During the past few years, a number of books have been published that explain how Drupal designers can do custom theming, but they tend to focus on the technical details of the theme layer, and not the practice of web design when using Drupal as a foundation. That rich yet neglected subject area is the focus of a new book, Drupal for Designers: The Context You Need Without the Jargon You Don't.

The book's author, Dani Nordin, is a Massachusetts-based web designer and the founder of The Zen Kitchen, a UX design business. The book was published by O'Reilly Media, on 1 August 2012, under the ISBN 978-1449325046. The publisher's page offers a description of the book, the table of contents, an author bio, and some free sample content (the first chapter). This publication is a compilation of three previously-released short guides — Planning and Managing Drupal Projects, Design and Prototyping for Drupal, and Drupal Development Tricks for Designers — with additional material. All of these books were written by Dani Nordin, and comprise the "Drupal for Designers" series by O'Reilly Media. (My thanks to the publisher for a review copy of this particular title.)

The book's material spans 328 pages, and is organized into seven parts, which do not include the introduction or the first chapter. The seven parts — each comprising at least two chapters — are largely presented in the same order that a typical reader would want to learn and implement the recommendations: Discovery and User Experience; Sketching, Visual Design, and Layout; Setting Up a Local Development Environment; Prototyping in Drupal; Making It Easier to Start Projects; Working with Clients; and Sample Documents.

Unlike most introductory Drupal books, this one wisely begins with a helpful dictionary of Drupal terminology. The first chapter also discusses the phases that compose a typical Drupal project lifecycle. Sandwiched in between is some guidance on where to place custom code in a Drupal directory system. The author advises that "Any module, theme, or other customization that you create for your site should always reside in sites/all" (page 2, and also reflected on pages 1 and 5). That may be true of contrib modules and themes, but certainly not custom ones, which are better located in sites/default or sites/[domain name]. She states that a child theme should be "stored separately in sites/all/<client_name>" (page 4). Actually, they should be placed in "sites/default/themes" or the themes subdirectory of a domain name directory. Finally, she recommends that for a multisite installation, one should keep "everything in sites/all" (page 5). Lumping everything into the "all" subdirectory would defeat the fundamental mechanism of multisite, which allows one to host multiple sites on a single Drupal installation, with their custom files and settings separated by domain name.

The first part of the book is loaded with valuable counsel on how to conduct the discovery phase of a website project, including coverage of project goals, user experience (UX), mockup tools, user personas, wireframes, prototypes, and the key components of a short-form project brief. It is evident from the narrative that the author is drawing upon a great deal of real-world experience, as well as lessons learned from other veteran web designers. The only blemish is where the author refers to "the project brief in Section 8" (page 45, repeated on page 254), and yet there appears to be no such section in the book. Perhaps she means Appendix A, which has an example project brief.

Once a design team has completed and received sign-off on a project brief — as well as any wireframes and other helpful preliminaries — a logical next step is to build the initial visual design. In the second part of the book, the author demonstrates how she uses sketches, style tiles, layout elements, greyboxing, grid systems, and Fireworks templates for crafting a visual design for a website. Throughout these chapters, she uses a redesign of her own personal website to illustrate the material. Both this part and the previous part of the book contain little information that is specific only to Drupal; thus, it could be useful to designers building websites using other CMSs.

Some readers of the book may already have up-to-date Drupal environments installed and configured on their development web servers. For those who do not, Part III will likely be appreciated, especially if the reader is using a Mac machine, because that is the environment to which the text and screenshots are geared. The author contends that "Windows seems to add an annoying layer of complexity to most of the command-line stuff" (page 102). Yet from my own experience, installing and using Git and Drush on a Windows PC is largely the same as in a Linux environment. Most developers complain that the main hurdle is Git's unintuitive workflow, which is independent of the operating system. The author touches upon some other tools, such as LESS and phpMyAdmin. Chapters 9 and 10 focus on Drush and Git, respectively. The last chapter in this section steps the reader through installing MAMP and Drupal. The discussion is generally comprehensible, except for the first paragraph on page 132, which is arguably the most confusing in the entire book. For instance, echoing a misstep seen earlier, it advises that all changes to your Drupal site should be stored in the sites/localhost directory, which contradicts the advice on the previous page, that all customizations to the site should be located in the sites/all directory.

The fourth part of the book covers prototyping in Drupal: gleaning from the client the information needed to define the content types for the website; choosing the appropriate modules for implementing the desired functionality; using views for displaying data; improving the HTML generated by views; creating custom Drupal themes; and using LESS to better manage the CSS within a theme. The advice is on target, except for the recommendation to use the Submit Again module, which does not have a Drupal 7 release, and has been replaced by the Add another module. Readers who are having difficulty locating the User Reference module mentioned by the author (page 187), can find it as a submodule in the References project. Lastly, the author instructs the reader to enable any base theme used (page 217), but actually it does not need to be enabled; installation alone is sufficient.

Part V, the briefest of them all, explains how to utilize the Features module, as well as Drush Make and installation profiles. Part VI comprises three chapters which offer guidance on how to propose an estimate for new projects, how to push back on unreasonable client requests, and how to learn from and document a finished project. This material is so closely related to that presented in the first part of the book — project discovery, planning, project briefs, etc. — that these final three chapters should have been incorporated into that earlier part. In fact, the first paragraph of this part states that it describes a phase of the discovery process that should be conducted prior to the phase described in Part I. Nonetheless, the author provides smart tips on some of the more difficult aspects of project management. The last part of the book comprises three appendices with sample documents — specifically, a project brief, a work agreement, and a project proposal.

On the publisher's page for the book, no errata have been reported, at this time. That is likely because the book appears to contain remarkably few errata: "What if there was" (pages 81 and 245; "was" should be "were"); "get familiar [with] the command line" (page 108); "a couple of" (page 172; should be "a few," as it is referencing three bullet points); ".less" (page 208, twice; should be "LESS"); "carpal tunnel[s]" (page 231); "original code [for] a feature" (page 242); and ".tpl" (page 266; should be ".tpl.php"). This is certainly a low number of errata for a technical book of this size. Kudos to the author and the O'Reilly editing team.

Overall, the book's style is clear and conversational, with only a few rough patches. Incidentally, the terms "directory" and "folder" are synonymous, but newbie readers who do not understand this could be confused when the two terms are used interchangeably, especially within the same sentence (e.g., page 109). Interspersed at various points in the text are interviews with people involved in web design, entitled "From the Trenches," which add perspective from designers other than the author. The reader will also find some natural humor and humility, which is always welcome in a technical work.

The author and publisher have made good use of the many screenshots, showing sample designs, Drupal user interface pages, etc. Unfortunately, for the Drupal pages, the admin theme used is the default, Seven, which results in black text on a gray background — a poor choice for such wide screenshots being compressed into small images on the page. Consequently, much of the text is barely legible, especially for anyone with imperfect eyesight.

From a technical point of view, the information provided is accurate and worthwhile. The only serious problem is the misleading advice, noted above, concerning the placement of custom modules and themes within the directory structure of a Drupal project — which was undoubtedly unintentional. The reader will encounter some HTML markup, a lot more CSS, and a minimal amount of PHP code. All of it is neatly formatted, and the only apparent problem is where a snippet of example code includes invalid nested "<?php" tags (page 188).

Despite these minor blemishes, this is one of the better-written Drupal books on the market. Web designers who will be working on Drupal projects, should be well rewarded in choosing this book as a solid starting point for their studies.

Michael J. Ross is a freelance web developer and writer."
Book Reviews

Submission + - Drupal 7 Multi Sites Configuration

Michael Ross writes: "All the leading content management systems (CMSs), including Drupal, use a combination of source code, in files, and user/configuration data, in a database. There may be some mixing of the two types of components — such as configuration settings stored in small files, or JavaScript code stored in the database — but most CMS-based websites generally employ this separation. One significant benefit is that updates to the non-custom code (the CMS's "core") can be easily made without overwriting user data or custom configuration settings. However, each website has its own copy of the core code, even if the websites reside on the same server — which wastes disk space and wastes developer time when all of those instances of core need to be updated. Thus there is growing interest in running multiple websites on a single core instance, despite the dearth of documentation for how to do so. For those in the Drupal world, one resource is a new book by Matt Butcher, Drupal 7 Multi Sites Configuration.

Released on 26 March 2012 by Packt Publishing under the ISBN 978-1849518000, the book spans 100 pages, organized into five chapters. For developers familiar with the subject — particularly those who have read the (few) articles that cover Drupal multisite — it may seem inconceivable that such a subject could fill an entire book. Yet for the countless Drupal developers and administrators who have encountered critical problems in implementing the advice proffered in the aforesaid articles, a definitive book could be invaluable. Even a brief perusal of the book's table of contents will show that there are more topics to be covered than one might have imagined. This review is based upon a print copy of the book kindly provided by the publisher. An electronic edition is available as well. More details can be found on the publisher's page, where visitors will find an overview, a table of contents, a brief author biography, and links for purchasing the print and electronic versions of the book.

In the first chapter, the author presents the fundamental ideas and many benefits of basing multiple Drupal websites on a single code base, known as "multi-site hosting." He discusses the most common configuration options, and then focuses on the one used throughout the book, namely, Drupal's built-in multi-site capability. One thinks of Drupal (and any other PHP applications) as running on top of the web server layer (typically Apache); so readers will likely be confused by the statement that virtual hosting "is a layer higher than Drupal's multi-site feature" (page 8). Aside from that, the discussion is straightforward.

The second half of the chapter provides detailed instructions on two methods for setting up a server for multi-site usage. The first method utilizes virtualization, specifically VirtualBox and Vagrant, which supposedly are ideal for spinning up disposable websites. However, the instructions for "Installing our tailored Vagrant project" quickly become problematic: The MultiSite Drupal Vagrant Profile directs the user to perform a git clone command, and then "cd multisite_drupal_vagrant_profile," which works fine, as that directory exists. But the next step, on page 15 of the book, calls for the reader to cd into "multisite_vagrant," which does not exist. Was the aforesaid directory intended? Apparently so, as otherwise the third command, "vagrant up," fails. Windows users, at the very least, may find these steps and those that follow to be quite perplexing. In my case, both VirtualBox and Vagrant initially appeared to fail installation; yet upon trying them again, they were apparently running. But certain operations discussed in the book, were never executed. I slogged my way through numerous cryptic error messages, and eventually gave up. Any other reader who experiences anything similar may also chuckle at the author's claim that "This made it easy to get an entire server environment configured and running without dealing with the nuances of configuration" (page 17). The second method presented for setting up a multi-site environment is to manually configure Apache and MySQL. Even though this approach is probably what most readers will settle upon, it is sadly given a backseat to Vagrant.

In the second chapter, "Installing Drupal for Multi-site," the author explains how to perform the standard Drupal 7 installation, but for three example instances. For those readers unable to get the Vagrant method working fully, or who for some other reason choose not to use it, the author's frequent references to Vagrant will likely be increasingly annoying. Fortunately, it tapers off about halfway through the chapter, as the author explicates the details of multi-site configuration, concluding with some tips on where the reader can find assistance if she encounters any difficulties during an install. The only flaw is, on page 41, where the author states that "the lines that typically need changing are highlighted," but none of them are.

The complexities of sharing configuration settings among multiple websites, compose the first topic addressed in the third chapter. All of the technical information appears to be sound, except for the advice on page 46 to add the line "global $conf;" in the shared settings PHP file, which is included in the site-specific settings files. A "global" keyword would only be needed if the line setting the array value $conf['site_slogan'] were inside a function, in which case the variable $conf would have only local scope without the keyword. The PHP documentation on variable scope notes that, for a (non-global) variable, its "scope spans included and required files as well." (I confirmed this with a quick test, in which a shared settings file changed the slogans of two different websites.) The author then explains how to share modules and themes among multiple websites, or keep them separate. The chapter concludes with information on how subthemes in separate Drupal 7 instances can use a single base theme.

The fourth chapter, "Updating Multi-site Drupal," focuses on the administration of multiple websites sharing Drupal code. Readers will learn of the numerous pitfalls that can catch the unwary (or at least the inexact). The fifth and final chapter, "Advanced Multi-sites," continues the discussion of other factors that can complicate and undermine working off a single Drupal code base: favicons in themes, robots.txt files, shared authentication, shared content, and other topics that one may never encounter if only working with simple websites — but could be critical otherwise. The only readily apparent flaw is his referring to the project at http://drupal.org/project/virtual_site as "the Virtual Site module" (page 80), when in fact it is the Virtual Sites module — not be confused with the actual Virtual Site module.

Unlike most Packt Publishing books, this one contains relatively few errata: "served [a] few" (on the first "About the Reviewers" page), "start its" (page 17; should read "start it"), "Drupal looks for, for site configuration" (page 30), "trouble shooting" (42), and a missing ")" in the first sentence on page 67. Scattered throughout the book are several instances of title case used inappropriately when referring to generic concepts that are not proper names, e.g., "Version Control System" (page 10). Fortunately, all of these flaws are quite minor, and should have been caught by the publisher's production team.

Some of the narrative is a bit redundant, such as a question being asked at the end of one section, only to be repeated at the beginning of the next section, sometimes more than once. The (unneeded) chapter summaries add to the repetition, as do the introductory paragraphs of each chapter, many of which merely tell the reader what she just read in the previous chapter. Yet the author's narrative style is generally clear and easy to understand.

The main problem with this book is the VirtualBox and Vagrant pair — specifically, the (unjustified) heavy emphasis upon them, and the spotty instructions for configuring them, which could easily confuse and discourage readers. The information is mostly confined to the first two chapters, yet all of it should have been left out, or consolidated and relegated to an appendix — especially as most readers would not use Vagrant for their development environments, and probably no one would use it for a live production environment.

But for anyone interested in setting up multiple Drupal-based websites that share a single code base, these blemishes are of little consequence. Although modest in size, Drupal 7 Multi Sites Configuration provides the most thorough coverage to date of this worthwhile yet oft-neglected subject.

Michael J. Ross is a freelance web developer and writer."
Book Reviews

Submission + - Head First Python

coder4hire writes: "Robert: Please change the attribution from "coder4hire" to "Michael J. Ross", linked to http://www.ross.ws/. Thanks!

Veteran computer programmers — adept with languages such as PHP, Perl, and JavaScript — typically have no trouble learning an additional language, often just by reading online tutorials and stepping through sample code. But for those new to programming, that approach can prove difficult and frustrating. Yet nowadays there appears to be growing interest among such people for learning how to write programs in Python, especially as it is seeing increasing use by Google and other organizations, and is often chosen as the primary teaching language in schools. For such budding programmers, one possible starting point is the book Head First Python.

Its author is Paul Barry, an experienced programmer and lecturer in computing science. The book was published by O'Reilly Media, on 7 December 2010, under the ISBN 978-1449382674. On the publisher's page, visitors can learn more about the book and its author, see feedback from readers, peruse the discussion forum, and read the errata identified so far (many of which appear to be fixed in the most recent printing). The book's example code is available from Head First Labs. It is packaged into a large Zip archive file, containing directories for all the chapters. Additional resources — such as test data — can be downloaded from a page on the website of the school where the author teaches, The Institute of Technology, Carlow in Ireland. (But don't bother trying to use the site's search functionality to find more information about him, because no search results are returned, as of this writing. Hmm, what is the Goidelic word for "fail?")

The book's material, spanning 494 pages, is organized into 11 chapters, plus a supplementary section for more advanced topics. In the first chapter, "Everyone loves lists," the author briefly explains how to find and install on one's computer Python and its IDLE development environment, if necessary. Oddly, he assumes that if it is already present on a Windows machine, then it will be found in the directory c:\Python31; this is repeated in the second chapter as well. More importantly, he mentions the (command-line) command to start the Python shell, but then immediately begins describing IDLE, without mentioning how to get it running. Most of the chapter explains how Python supports lists and functions, although the coverage of the latter topic is much too brief, considering how critical functions are in any programming language, including Python.

The second chapter shows how to bundle up functions into modules, and make them available to other developers through distribution utilities. This may be an important topic, yet it is inconceivable to me as to why, so early in the book, the author dives into the rather involved details of registering with PyPI and distributing a Python module to the rest of the world, before even introducing such language basics as input/output, files, and objects. (More on that later.)

If the reader perseveres through all the flaws in the first two chapters, then she will likely find that the quality of the narrative gradually improves throughout the rest of the book. An example of this is the third chapter, which addresses basic file access and exception handling. The following chapter, which focuses on data persistence, extends the discussion of how to save in-memory data in files, including the use of the standard library "pickle" for dumping and later loading any type of data. The next few chapters introduce the reader to increasingly complex ways of representing data, in the form of lists (again), dictionaries, and (object-oriented) classes. The discussion is fairly clear, except readers familiar with other object-oriented languages may be confused on page 194, where class attributes are being defined in the constructor only. In fact, the author does not fully explain where attributes can be defined, and what their resultant scope would be.

The seventh chapter roughly marks the halfway point in the book, and also is where the focus shifts from developing Python programs to releasing them to the public. The author begins by incorporating techniques presented earlier in the book, to build a Python-based web app, using the popular Model-View-Controller (MVC) paradigm. The next chapter shows how to port those web apps to mobile devices. Chapter 9 extends these topics, by demonstrating how to query for and accept user data in HTML forms on web pages, and in similar dialogs on Android phones — as well as how to store that data in an SQLite database. The next logical step is to learn how to make Python apps scalable, as well as cloud-based, in this case using the Google App Engine (GAE). Readers are also introduced to Django, for form validation. The final chapter, and the appendix, cover a number of miscellaneous topics, such as how to spreadsheet-type data storage, development IDEs, variable scope, unit testing, and regular expressions.

Most readers should find that the relaxed writing style makes this book approachable, though fairly lengthy. Like most if not all of the other books in the Head First lineup, this one is made more palatable with a sense of humor that is not silly — a welcome improvement to any programming book. The best parts are in the "fireside chats," which are fictional and sometimes pointed conversations, oftentimes between two similar components of Python.

Yet the narrative is far from perfect. Some of the phrasing is ponderous, e.g., "Perform the edits to your code" (page 113); why not just "Edit your code?" A few concepts are used without explanation, e.g., the Python value of "None" (page 80). Some technical slang terms are used quite early in the book, yet with no definitions or explanations for the neophyte — e.g. "app" and "webapp" (both on page xvi). Admittedly, most readers of this book will be programmers or other techies, who feel comfortable with those terms. But the Head First series is intended for people just getting started, and thus all such terms should be explained up front, if only briefly.

There are numerous errata not found in the aforesaid list (on the O'Reilly Media website): "tools to for accepting" (page xviii), "design user-friendly websites" (xxvii; should be "learn Python"), "try and" (14, 84 twice, and 188; should be "try to"), "As your plan to" (37; "you plan" was likely intended), "utiliites" (49), "users that" (50; should be "users who"), "argment" (52), "a iterable" (53 and 54), "the the list on screen" (64), "the your latest version" (65), "a argument" (71), "gives you with a chance" (88), "file's contents" (123; incorrect plural possessive), "the facilities pickle" (134; probably should be "the pickle facilities"), "your were" (170), "it's new mode" (185; no apostrophe in "its"), and at this point I ceased recording errata. These flaws, plus the 119 already reported, suggest that the author and O'Reilly copy editors did not perform enough quality control when working on the manuscript.

One glaring problem with the material is the dramatic unevenness in the depths of coverage, from one topic to the next. For instance, even though the book is aimed at readers who already know another programming language (page xxiv), an entire section is devoted to establishing the (obvious) non-scalability of having to use an individual print() statement for every item in a list, and the superiority of instead iterating through the list (page 15). Yet in the same chapter, only a couple pages (29-30) are provided to explain functions, with no discussion of topics important to any programmer, such as whether one can set parameters to default values, or how to pass arguments by reference, if it's even possible. Some of this unevenness is due to the book's goal of presenting technical information in an easily-digestible form; for instance, in Chapter 7, the reader is told how a web server returns a web page, but later faces the minefield of invoking Python's built-in web server on a CGI server.

A second significant problem is the often-illogical ordering of material — both high level and low. Chapter 2 illustrates both cases: The author recommends that the reader release her code to the public (in the form of modules) after presumably having learned only one chapter's worth of material, when such code would undoubtedly be unready for public consumption. At a much lower level, the first "There Are No Dumb Questions" entry in the chapter briefly discusses various editors that could be used for writing Python code. This information should have been presented at the beginning of the first chapter, or even in the introduction — not after the reader has already chosen whatever editor seemed most convenient at the moment, and probably saved at least one file of code. A third variation of this problem, is when the reader is tested on concepts not previously presented — such as the "Who Does What?" section on page 53, which quizzes the reader on half a dozen functions, none of which the reader has presumably even seen before, and some of which are never mentioned again in the book!

In terms of the typography of the print version of the book, I found the font face and size to be problematic, especially on those pages where the text appears to have been printed a bit too lightly — at least in the review copy of the book kindly provided to me by the publisher. For instance, all of the code on page 227 is practically unreadable. Throughout the book, in the snippets of code, the comments are a light gray making them quite difficult to read — probably because these are screenshots of IDLE sessions, in which comments are by default displayed in green, which apparently does not translate well to grayscale illustrations.

Overall, this book appears to have received less oversight and editing than is typical in the Head First series. If you are a veteran programmer searching for a concise treatment of Python, then this book is not optimal for you. Yet if you seek an engaging and highly visual introduction to an elegant programming language, then Head First Python can be a worthwhile place to start your journey.

Michael J. Ross is a freelance web developer and writer."
Book Reviews

Submission + - Google+: The Missing Manual

coder4hire writes: "Robert: Please change the attribution from "coder4hire" to "Michael J. Ross", linked to http://www.ross.ws/. Thanks!

Prior to Google+, the company's previous attempts at social networking — Orkut, Dodgeball, Jaiku, Wave, and Buzz — were largely failures, and tended to frustrate users who had devoted time and effort to contributing content and establishing connections with other users, only to see the services wither on the vine. In contrast, Google+ appears to be receiving far more nurturing by the Internet behemoth, and as a result has arguably better chances of not just surviving, but expanding to the point of eventually challenging Twitter and Facebook. Like its rivals, Google+ offers online help information to explain to newcomers the basics of how to use the service. But there is little to no advice on how to make the most of its capabilities, and even the basic functionality is not always clearly explained. That is the purpose of a new book, Google+: The Missing Manual.

Authored by Kevin Purdy, the book was published by O'Reilly Media, on 30 December 2011, under the ISBN 978-1449311872. The publisher's page has a brief description of the book, its table of contents, some comments on the book from customers and reviewers, a couple errata (as of this writing), and links for purchasing the print version (such as the one kindly provided to me by the publisher) and/or the e-book versions (in EPUB, MOBI, and PDF formats). The "missing CD" page has links to most if not all of the online resources mentioned in the text.

Like the other entries in the Missing Manual series, this one starts with the basics, and builds upon that foundation. It does not assume any knowledge of Google+, or even possession of a Google account.

The book's material is organized into nine chapters, for a total of 232 pages. The first chapter, "Getting Started," explains exactly how to join Google+, invite friends to your new network, and configure your profile, including your privacy settings and a photo (even tweaking it online). The second chapter, "Managing Contacts with Circles" covers how to create new circles, edit and organize existing ones, share them with other Google+ users, and find people to add to your circles. But, oddly, the information is not presented in that logical order. The author explicates the advantages of using more than the default four circles provided by Google. Some points are repeated, but briefly enough that it is inconsequential.

While the first two chapters lay the foundation for joining Google+ and setting up your account and circles, the next three chapters explore the details of using this service — starting with "Streams, Sharing, and Privacy," which explains the various types of streams (main, circle, Notification, and the now-defunct Incoming stream), as well as the user interface elements for those streams and the individual posts they comprise. The author also demonstrates how to write your own posts, specify who gets to see them, edit your posts, and interact with the posts submitted by other users. The next chapter explores the important topic of notifications, which are sent as e-mail messages, smartphone messages, etc. Helpfully, the author discusses the differences between the user interfaces of the Android and iPhone notification apps. The subsequent chapter fully explains how to share photos and videos with other Google+ users, as well as how to upload and perform basic editing of images. However, it may have been more logical to present the latter information before the former.

For people who want the capabilities previously only provided by commercial web conferencing services, hangouts might be the most welcome feature of Google+. Chapter 6 explains how to set up and participate in these videos/audio meetings online, as well as how to incorporate Google Chat, YouTube videos, and Android devices. The subsequent chapter, "Searching and Sparks," has plenty of advice on how to search for other Google+ users and the content they contribute. The penultimate chapter dives into the differences you may encounter when using Google+ on small screen devices — specifically, Android and Apple smartphones and tablets. The last chapter, which is the briefest of the bunch, is also likely to prove the least useful to most readers, as it covers how to get started playing the games built into Google+.

The book does not cover Google+ Pages, which was likely introduced after the final draft of the book was submitted to the publisher. Readers are directed to an untitled 14-page PDF file that covers the essentials of Google+ Pages. Oddly, the publisher's page links to that file with the text "Download Example Code"; but there is no example code for this book. The supplement contains a few flaws: "box pop-up box" (page 4), "using a promoting your Page" (9), and "his her name" (11).

Speaking of which, given the relatively modest number of pages in this book, and the limited amount of text on each one, this book contains far too many errata: "works different" (page xiii; echoes of Apple's infernal "Think Different" marketing campaign?), "If typing web addresses by hand that isn't" (page 3), "a different a social networking site" (4), "she's added you [to] her" (54), "added to [the] +Add box" (58), "even if [you] just" (79), "and the[n] click the" (79), "settings that lets you can choose" (83), "modicum [of] more fuss" (105), "share its photos [with] specific circles" (117), "where [the] photo" (124), "just like [the] lightbox view" (126), "and or" (147; should read "and/or"), "an job" (148), "how to [use?] Google+ running" (169), "search find" (170), "bring up to the same list" (180), "The form exact" (185; should read "The exact form"), "you can't get start" (191), "in in" (193), and "a box let you know" (194).

Some of the statements in the narrative are odd — for instance, "Halloween right around October 31" (page 7; when else would Halloween occur?). Other phrases are poorly worded — for instance, "whenever you feel irked or like something must be broken" (44), "maybe an extra like a link" (60), and "select an item from the menu that appears to see only circle-related notifications" (80). Lastly, at least one pair of verbs have inconsistent form ("start" and "mentioning" on page 62). All of these blemishes should have been caught by the copyediting crew. But for the most part, the narrative is straightforward. It is occasionally livened up with a bit of humor, which is good, because portions of the text begin to sound the same, as a result not so much of the author's writing, but more the Google+ interface itself.

Only a few technical errors are immediately evident — for instance, on page 61, the author refers to a for-loop in computer code incorrectly: "+1 is a common way of making a program run over and over again." But it is not a program that is being repeated, but rather a code block.

Scattered throughout the text are numerous text boxes — most of which are labeled "Note" or "Tip." Unfortunately, they are set in a font that is a bit too small for comfortable reading. Also, there does not appear to be any difference among these types of information sections, yet there are at least half a dozen different names for them.

All of the key topics are nicely illustrated with sample screenshots, in grayscale, oftentimes with relevant controls circled or otherwise indicated. The only weakness is that the author typically does not mention which figure is being referenced in the text — not that that would help much anyway, since none of them have figure numbers. It's usually clear from the context, but not always.

Yet the very existence of this book may give readers some pause: If a book of this size is required to explain how to use a social networking service aimed at the general public, perhaps the Google+ user interface needs to be overhauled and made more intuitive? Yet that process is probably underway, because Google+ is under constant revision. Thus there will be portions of the text and screenshots that differs somewhat from the current incarnation of the user interface and its features. But for most of these instances, it is easy enough to determine how what you read in the book correlates with what you might see on the screen.

The primary weakness of this book is that it does not attempt to explain how Google+ might be integrated into a business's online marketing strategy, nor how it compares against Facebook or Twitter in terms of its advantages and disadvantages. In fact, as noted above, the book addresses Google+ Pages only in a supplementary document. Such information would have made this entry in the Missing Manual series far more valuable.

However, one forte of this book is that the author has clearly put effort into learning and explaining the privacy implications of the various Google+ features — critical in this era of evaporating privacy and data breaches on an unprecedented scale.

On balance, he largely achieves his objective. Google+: The Missing Manual is an informative and approachable introduction to Google's social network.

Michael J. Ross is a freelance web developer and writer."
Books

Submission + - Teach Yourself HTML5 Mobile Application Developmen

coder4hire writes: "Robert: Please change the attribution from "coder4hire" to "Michael J. Ross", linked to http://www.ross.ws/. Thanks!

The last few years have seen the emergence of several significant advances in web technologies, including HTML5 and CSS3 — all impacting the development of traditional and mobile-centric web sites. In turn, various technical book publishers have released titles addressing one or more of these technologies. While one book may focus on HTML5 and the new JavaScript APIs, another might include extensive coverage of CSS3, with little mention of JavaScript. A recent title, Sams Teach Yourself HTML5 Mobile Application Development in 24 Hours, focuses on some of the more commonly employed elements introduced with HTML5, and how they can be used for creating mobile sites and applications.

This book was authored by Jennifer Kyrnin, who has plenty of experience in using as well as teaching web design techniques, and who curates the Web Design / HTML section of About.com. The book was put out by Sams Publishing (an imprint of Pearson Education) on 25 November 2011, under the ISBN 978-0672334405. On the publisher's page, visitors will find the book's description and table of contents, and some sample content in a PDF document, including the first chapter, "Improving Mobile Web Application Development with HTML5." The page appears to not list any reported errata. This book is available in both print and electronic formats (EPUB and PDF), but prospective buyers should be warned that the e-book is less than seven dollars cheaper than the print version ($25.59 versus $31.99), despite the huge disparity in production and distribution costs. The author's web site offers additional information, primarily in the form of a newsletter devoted to HTML5. The preface claims that this second web site has the example source code from the book, as well as ways to ask questions and report errata; but if so, they are well hidden, as of this writing.

Spanning 496 pages in total, the book's material is organized into two dozen chapters, as is usual with any of the books in the "Sams Teach Yourself X in 24 Hours" series. Readers may well wonder if this artificial constraint causes the various authors to structure their books in a way that does not always make sense. In the case of this title, there does appear to be some forced splitting of material between two chapters, namely, "Building a Mobile Web Application" and "Converting Web Apps to Mobile." Conversely, three topics that may deserve their own chapters are lumped together, in "WebSockets, Web Workers, and Files." Moreover, it is arguably unrealistic to expect that the typical reader will be able — or would even attempt — to read and comprehend a technical book of such length and subject matter in only 24 hours — to say nothing of the time required to type in the sample code (in order to test it and reinforce the information learned). This "teach yourself in 24 hours" format borders on "brain surgery in three easy steps." Lastly, it leads to silly phrasing such as: "a result of reading the hour" (page xvii).

The chapters and appendices are grouped into four parts, the first of which is titled "Building Web Pages and Applications with the Open Web Standard." The structure of the first chapter is replicated in all of the other chapters: The author briefly lists what the reader will learn, and then begins explicating the concepts, illustrated with example code wherever appropriate. Each chapter concludes with a summary (which is of no value), several FAQs (whose material should instead be folded into the main chapter content), and a workshop section comprising quiz questions and exercises for the reader to tackle. Part I's eight chapters introduce HTML5, web applications, the W3C Open Web Standard, the new HTML5 elements and their attributes, CSS3 (with justifiably limited coverage), mobile browser detection, JavaScript, and jQuery. Then the author presents the basics of how to build mobile web apps, both from scratch and from using a non-mobile web site as a starting point.

Part II, "Learning the HTML5 Essentials," goes into greater detail of numerous basic aspects of HTML5: the new HTML5 sectioning, heading, and semantic elements; the semantic repurposing of some HTML 4 elements; the new canvas element (with limited coverage of this extensive topic); new typography support; audio and video elements; new form capabilities; HTML editable content, spell checking, and other user interactivity; microformats, microdata, and RDFa; in-page drag and drop; and new functionality for linking (the <a>, <area>, and <link> elements). Readers should note that the discussion in the ninth chapter on the new sectioning elements starts off rather confusingly, but soon improves, making it well worth reading.

The third part of the book, "HTML5 for Mobile and Web Applications," begins with an introduction to web apps, as well as the HTML5 application programming interfaces (APIs) and data sets upon which they may rely. The author then discusses specific APIs that can be of great use in web apps — specifically, the WebSockets, Web Workers, and File APIs, which allow one to make asynchronous connections between the app and a remote host, perform scripted background processing, and access local files. The remaining chapters show how to: make a web app usable even when it is disconnected from the Internet; save data on the client side (using local storage, session storage, Web SQL, and IndexedDB); control the browser history; geolocate the client; and convert an HTML5 application into a native mobile app, with detailed information on using PhoneGap. Aside from the index, the book concludes with three appendices that cover: answers to the end-of-chapter quizzes; a list of the HTML5 elements and their more commonly-employed attributes; and a list of other books and web sites that address HTML5 and mobile design and development.

The average programming book — particularly one of this size, and in a first edition — will contain some errata, and this one is no exception: "shortcut style" should read "shorthand style" (page 37); "Specific[,] Measurable" (87); "complimentary" should read "complementary" (93); the "By the Way" section on page 131 is missing a close parenthesis; "html5elmeents" (136); "will [be] eventually" (184); "a straight line [] they" (184); "makes build[ing] forms" (223); "method[s] exist" (362); "the page [it] is on" (383); and "()creates" (390).

There are some other parts of the text where either the author or the editorial team may have been careless — for instance, the figcaption and figure tags repeated on pages 16 and 18. Fortunately, such cases are few and far between. The HTML, CSS, and JavaScript code is generally of decent quality, except much of the HTML markup is not indented properly. In the JavaScript code, most if not all of the string concatenation is jammed together, making the elements difficult to distinguish (e.g., page 72). Also, some of the HTML does not utilize the more streamlined attributes of HTML5, such as <script type="text/javascript"> (e.g., page 20), or is not well formed, such as </li> tags missing (e.g., pages 236 and 250).

The author occasionally uses terminology that would be comprehensible only to someone who already has the knowledge that the narrative presents for the first time, without providing at least a quick explanation, e.g.: the !"!" JavaScript operator (page 55); the terms "rollover" and "user agent" (page 69 for both); and "the manifest comes up 404 or 410" (page 342). Some of the advice may be true, but is rather outdated, such as the admonitions in the first chapter to not use frames, nor to use tables or spacer images for layout. Those principles were validated and disseminated many years ago. Some statements could easily be misinterpreted by beginners, e.g., "As long as your HTML file is in the same folder as your style sheet file, it will load your styles when your page is loaded" (page 36). Other statements are not explained in detail or substantiated, and consequently the reader will probably not understand the reasoning behind it, e.g., "using the min- and max- extensions is more effective" (page 61), and "a separate mobile domain [] makes your mobile site easier to find" (page 10). Readers may disagree completely with some of the claims, e.g., "XHTML [is] very difficult to write" (page 2).

There are only two discernible problems with the production of the book: In some of the HTML code, curly quotes are used (e.g., page 303). Secondly and more importantly, the san-serif font used to indicate keywords looks much too similar to the serif font of the regular text, causing the keywords to blend into the surrounding material.

Yet the main problem with the narrative is the somewhat erratic manner in which the author skips from one topic to the next, often providing just a few paragraphs or even sentences for each topic — giving the impression that critical information may have been neglected as a result of the less-than-methodical organization of the material. Most of those topics are discussed again, in varying levels of detail, in later chapters. This is not optimal, because technical readers generally hope to find full coverage of any given topic in one place; hence, it can be frustrating if the information is scattered throughout a book. This is especially true if the reader has already read the book in full, and is now returning to it in order to utilize it as a reference source. For instance, in many cases, attributes are presented, but without detailed explanation or examples. Fortunately, the worst of it seems to be confined to Part I of the book, which contains most of the introductory material. Most if not all of the key concepts appear to be addressed to at least some extent. Lastly, some of the information that should have been presented right up front, is not, e.g., the definitions of HTML5 on pages xiv, 1, and 52.

Unlike most programming books nowadays, this one has few instances of phrasing that would baffle the reader for long, and there are no goofy attempts at humor. For most of the topics, the information provided is the minimum to achieve the bulk of the desired results. The advantage to this is that the narrative is generally concise and quick to read, and the author is able to cover a lot of ground without having to package such a broad topic in a (more expensive) tome. Some of the narrative is quite good, such as the explanations of the various browser exceptions involved in the HTML5 drag-and-drop functionality.

Despite the aforementioned blemishes, this book is definitely worth a look, because it is currently one of the most complete tutorials for learning how to use HTML5 for creating mobile apps and web sites.

Michael J. Ross is a freelance web developer and writer."

Slashdot Top Deals

If all else fails, immortality can always be assured by spectacular error. -- John Kenneth Galbraith

Working...