Instant Handlebars.js – A short but effective how-to guide – #programming #bookreview

Instant Handlebars.js

Learn how to create and implement HTML templates into your projects using the Handlebars library
Gabriel Manricks
(Packt Publishing – e-book, paperback)

“Short, fast, and focused.” These are the three promises offered for Gabriel Manricks’ new book, Instant Handlebars.js, from Packt Publishing. And, at just 62 pages in print format, it lives up to those vows.

Manricks explains and demonstrates Handlebars using five well-structured sections. First, he introduces Handlebars.js and describes what a templating engine is and does. He notes that “[t]he purpose of using a templating engine such as Handlebars is to generate some kind of viewable content (usually HTML pages), dynamically.” He then shows how to download the Handlebars library and create a “Hello {{name}}” template and a simple helper.

His “Top 6 Features you need to know about” section goes to the heart of Handlebars.js and shows how you can organize large projects and pre-compile templates.

The Top 6 topics include: (1) Expressions—“the core of templates”; (2) Helpers—“[t]hese are where Handlebars gets its extendibility”; (3) Partials—“the building blocks of the template world” and important for modular design; (4) Structuring a Handlebars app—the pros and cons of various potential structures; (5) Pre-compilation—which can lead to “a more optimized and efficient site”; and (6) Logging and comments—“writing clear and debug-able templates and helpers, so you can easily test and maintain them in the future.”

In the book’s final section, “People and places you should get to know,” Manricks describes some individuals and websites you should follow so you can “stay up to date and dive deeper into the Handlebars community.”

Despite its small page count, the book contains numerous short code examples that show how to put Handlebars.js to work in HTML files.

You need at least some modest experience with JavaScript and HTML to get full benefit from this book. You also will make brief use of Node.js to install Handlebars.js.

If you have done any work with Ember.js, you already have picked up some Handlebars.js experience. However, even here, this short, handy guide can help you get a better understanding of how to use Handlebars, with or without Ember.

Instant Handlebars.js can be ordered in e-book or paperback format direct from Packt Publishing’s website. Or, the Kindle version and the paperback can be ordered via Amazon.

Si Dunn

Head First HTML and CSS, 2nd Edition – An effective and entertaining guide now updated for HTML5 – #bookreview

Head First HTML and CSS, 2nd Edition
Elisabeth Robson and Eric Freeman
(O’Reilly,
paperback)

As a techie, I am admittedly a bit mediocre. I do know most of the critical differences between a couch and CouchDB. But I don’t speak fluent JavaScript or Klingon. I seldom eat regular expressions for breakfast. And I never brush my teeth with JSON or even SQLite.

In other words, I have to look up stuff in books, mess around with code examples, and try to puzzle out why I just wrote a function that completely blew up when I called it.

The clearer the how-to instructions and code examples, the better for my time-battered brain.

So, here is no surprise: I love the “Head First” series from O’Reilly. Its books introduce topics in amusing, easy-to-handle bites (and bytes) that are well illustrated and presented in orderly progressions. Typically, you create a simple project and spend the rest of the text learning how to add functions or features to it and improve its appearance and overall usability.

When I am in a mood to play for a few minutes or an hour or so, I enjoy opening a “Head First” volume. I can quickly teach my old-dog-self new tricks by working through a few of the examples and lighthearted explanations.

First published in 2005, Head First HTML and CSS has now been updated to cover HTML5. If you are a newcomer wanting to work with web pages or expand some basic web-page knowledge, Elisabeth Robson’s and Eric Freeman’s new 2nd edition is an excellent guide. It shows, step by step, how to create standards-based web pages using HTML5 and cascading style sheets (CSS).

Do not be intimidated by the book’s size (723 pages) and heft (nearly four pounds).  It will get you off to a fast start learning basic Hyper Text Markup Language (HTML). Then it introduces each new topic in small steps, with plenty of screenshots, diagrams, notes, tips, exercises, and Q&A sessions to help you stay on track.

Here is how the book is organized:

  1. The Language of the Web: getting to know html
  2. Meet the “HT” in HTML: going further, with hypertext
  3. Web Page Construction: building blocks
  4. A Trip to Webville: getting connected
  5. Meeting the Media: adding images to your pages
  6. Serious HTML: standards and all that jazz
  7. Adding a Little Style: getting started with CSS
  8. Expanding your Vocabulary: styling with fonts and colors
  9. Getting Intimate with Elements: the box model
  10. Advanced Web Construction: divs and spans
  11. Arranging Elements: layout and positioning
  12. Modern HTML: html5 markup
  13. Getting Tabular: tables and more lists
  14. Getting Interactive: html forms

The authors introduce basic HTML before taking you into HTML5. And they deliberately advocate “a clean separation between the structure of your pages and the presentation of your pages.” They teach you “to use HTML for structure and CSS for style….” They also show you how to test your web pages using more than one browser, so you can learn how to create pages “that work well in a variety of them.”

They do not try to cover everything in their “brain-friendly guide.”  They offer Head First HTML and CSS, 2nd Edition as “a learning experience, not a reference book.” (The book’s appendix, by the way, is titled “The Top Ten Topics (We Didn’t Cover): leftovers.” It focuses on more things you might want to consider and try.)

Once the authors have tossed you in head first and helped you develop a reasonably good feel for HTML5 and CSS, then you can go look for the fancy stuff.

You will have better notions of what to do with it once you have it.

Si Dunn

WebGL: Up and Running – 3D Web graphics for the beginner, with expert guidance – #bookreview

WebGL: Up and Running
Tony Parisi
(O’Reilly,
paperbackKindle)

“WebGL,” Tony Parisi notes, “brings 3D to the browser, providing a JavaScript interface to the graphics hardware on your machine.”

Parisi is co-creator of the VRML and X3D languages which have become ISO standards for networked 3D graphics. So he knows a bit about using WebGL (Web Graphics Library) for low-level 3D renderings on the Web. If you are ready to give Web 3D graphics a try, you need WebGL: Up and Running.

Parisi’s new book is a well-written “quick introduction” to 3D programming. It has 211 pages and numerous code examples and screen shots. And it is organized into eight chapters and an appendix that provides links to several WebGL resources.

The first two chapters offer an overview of the WebGL API and Three.js, the open source JavaScript library that is used in the programming examples.

Chapters 3 through 6 focus on “the details of programming graphics, animation, and interaction” and explore “WebGL’s breakthrough capabilities for integrating 2D and 3D into a seamless user experience.”

Chapters 7 and 8 look at “real-world WebGL production topics, from authoring tools and file formats to building robust and secure WebGL applications.” Also in`Chapter 8, Parisi shows how to build a full WegGL application, a racing game.

You will need some familiarity with HTML, CSS, JavaScript, jQuery and Ajax to use this book. But you won’t need prior 3D graphics experience. The author’s goal is to get you up and running well enough that you can start using WebGL and learning as you go.

Still, “even the 3D graphics expert will learn something new” from this how-to guide, promises Ken Russell, the Khronos Group’s WebGL Working Group chair, in the Foreword to WebGL: Up and Running.

Si Dunn

Drupal for Designers – Putting Drupal to work, with good planning and design up front – #bookreview

Drupal for Designers
Dani Nordin
(O’Reilly, paperbackKindle)

Drupal has (1) a lot of fans, (2) a lot of people who wonder what the heck it is, and (3) a lot of people who complain about it.

Sometimes, a Drupal user is each of these at the same time.

Officially, Drupal is “an open source content management platform powering millions of websites and applications.” Thousands of add-on modules and designs are available, and individuals, groups, organizations and companies use Drupal “to build everything from personal blogs to enterprise applications.” Indeed, some big and well-known sites use Drupal, including The Economist, Examiner.com and the White House, to name a few.

There is a learning curve, but Drupal specialist Dani Nordin’s new book can help you (1) get started with Drupal, (2) help you wrap your mind “around the way Drupal handles design challenges,” and (3) help you master important techniques and tools. You will also learn the importance of doing detailed site planning first and keeping up with version control, even if you are a solo designer.

The book focuses on Drupal 7, but much of the material can be used with Drupal 6. Some parts of the book are “version-agnostic.”

Dani Nordin also offers case studies involving two of her ongoing efforts, so readers can “see how these ideas work in the real world, with all the frustrations and moments of unexpected joy that happen in real projects.”

She adds: “Through these projects, I can show you a typical Drupal design process—from creating the project brief to ideation and sketches to prototyping and applying our look and feel to the site’s theme.”

Drupal for Designers is a compilation of three previous short guides, with new materials added. It is aimed, the author says, at “the solo site builder or small team that’s itching to do interesting things with Drupal but needs a bit of help understanding how to set up a successful Drupal project.”

To work with Drupal, you should have some familiarity with HTML and CSS, and you should be open to learning some PHP.

Drupal for Designers has 303 pages and 22 chapters that are grouped into seven parts:

  • Part 1: Discovery and User Experience
  • Part 2: Sketching, Visual Design, and Layout
  • Part 3: Setting Up a Local Development Environment
  • Part 4: Prototyping in Drupal
  • Part 5: Making It Easier to Start Projects
  • Part 6: Working with Clients
  • Part 7: Sample Documents (for designers, including a project brief, a work agreement, and a project proposal)

There is no one “right” way to use Drupal, the author notes. “Every Drupal designer and site builder has his or her own approach to creating projects….”

But careful planning and design work up front will be essential to your success, she emphasizes.

Si Dunn

Getting Started with D3 – A guide to working with data-driven documents – #bookreview #javascript

Getting Started with D3
Mike Dewar
(O’Reilly, paperbackKindle)

This focused, 58-page how-to guide introduces the basics of D3, a JavaScript library written by Mike Bostock.

The D3 library, a free download, can be used to manipulate documents based on data. According to the Data-Driven Documents website, “D3 allows you to bind arbitrary data to a Document Object Model (DOM), and then apply data-driven transformations to the document. For example, you can use D3 to generate an HTML table from an array of numbers. Or, use the same data to create an interactive SVG bar chart with smooth transitions and interaction.”

Mike Dewar’s book is aimed at “the data scientist: someone has data to visualize and who wants to use the power of the modern web browser to give his visualizations additional impact.” However, if you don’t consider yourself a data scientist, but are comfortable with coding and manipulating data, this book can still show you how to use a combination of JavaScript and SVG [Scalable Vector Graphics] “to build everything from simple bar charts to complex infographics.”

Getting Started with D3 has six chapters, and they are illustrated with code samples and examples of graphics produced using D3.

  1. Introduction
  2. The Enter Selection
  3. Scales, Axes, and Lines
  4. Interactions and Transitions
  5. Layout
  6. Conclusion

In his conclusion, Mike Dewar, a data scientist at Bitly, offers encouragement and additional resources for digging deeper into D3. “The documentation for D3 is extensive,” he writes, “and is available at http://d3js.org along with a huge gallery of examples. This is an essential resource, both for reference and inspiration.”

His book is also an essential resource, for learning the basics of using D3.

Si Dunn

Web Development Recipes – To make life easier for you & your users – #programming #bookreview #in

Web Development Recipes
By Brian P. Hogan, Chris Warren, Mike Weber, Chris Johnson, and Aaron Godin
(Pragmatic Bookshelf, paperback, list price $35.00)

“It’s no longer enough,” this book’s authors state, “to know how to wrangle HTML, CSS, and a bit of JavaScript. Today’s web developer needs to know how to write testable code, build interactive interfaces, integrate with other services, and sometimes even do some server configuration, or at least a little bit of backend work.”

Their handy, helpful new work offers more than 40 “practical recipes that range from clever CSS tricks that will make your clients happy to server-side configurations that will make life easier for you and your users. You’ll find a mix of tried-and-true techniques and cutting-edge solutions, all aimed at helping you truly discover the best tools for the job.”

Web Development Recipes is organized as seven chapters and two appendices:

  • Chapter 1: Eye-Candy Recipes – Covers a few ways to use cascading style sheets (CSS) and other techniques to improve the appearance of web pages.
  • Chapter 2: User Interface Recipes – Focuses on techniques to make better user interfaces, including JavaScript frameworks like Knockout and Backbone. Also shows “how to make better templates for sending HTML emails.”
  • Chapter 3:  Data Recipes – Explores ways to work with user data. Shows how to create a simple contact form and gives “a peek” at using CouchDB’s CouchApp to build a database-driven application.
  • Chapter 4: Mobile Recipes – Shows ways to work with mobile computing platforms. Focuses on jQuery Mobile, handling multitouch events and helps you “dig a little deeper into how to determine how and when to serve a mobile version of a page to your visitors.”
  •  Chapter 5: Workflow Recipes – Focuses on improving your processes, including using Sass to “make your life easier when managing large style sheets.” Also introduces CoffeeScript, “a new dialect for writing JavaScript that produces clean, compliant results.”
  • Chapter 6: Testing Recipes – Using automated tests to help you build “bullet-proof” websites. Also, “how to start testing the JavaScript code you write.”
  • Chapter 7: Hosting and Deployment Recipes – Building a virtual machine to be used as a testing environment, so you can test before moving to a real production environment. Also covers setting up secure sites, doing redirects properly, and automating website deployments “so you won’t accidentally forget to upload a file.”
  •  Appendix A1:  Installing Ruby - Several of the web development recipes require having the Ruby programming language installed on your computer.
  • Appendix A2: Bibliography – Lists six works for further reference.  

Along with Ruby, there are a few other prerequisites:

  • HTML5 and jQuery
  • Working with command-line prompts in a shell on a Windows, OS X or Linux machine.
  • QEDServer (can be downloaded from the book’s website).
  • A virtual machine (either set up with help from the book or downloaded already configured from a website link in the book).

The source code for the book’s projects also can be downloaded from the book’s website.

In many of the recipes, the authors assume that you have “a little experience with writing client-side code with JavaScript and jQuery.” But if you don’t, they contend you can still learn a lot by reading the recipes and studying the source code they’ve provided.

Each recipe is presented in a straightforward problem, ingredients and solution format, with clear explanations, code examples, illustrations, tips and links to more information.

If you are doing web development work or wanting to move into that arena, Web Development Recipes could be a very good book to keep handy.

#

Si Dunn is a novelist, screenwriter, freelance book reviewer, and former software technical writer and software/hardware QA test specialist. His latest book is a detective novel, Erwin’s Law. His other published works include Jump, a novella, and a book of poetry, plus several short stories, including The 7th Mars Cavalry, all available on Kindle.

Head First HTML5 Programming – #javascript #html5 #programming #bookreview

Head First HTML5 Programming: Building Web Apps with JavaScript
By Eric Freeman and Elisabeth Robson
(O’Reilly, list price $49.99, paperback)

This is not your father’s turgid programming textbook.

Indeed, even if you are not interested whatsoever in messing around with JavaScript and learning how to be an HTML5 programmer, you may still enjoy reading this book and studying how it is put together.

Head First HTML5 Programming is a fun and entertaining mixture of graphics, text and coding examples. But, more than that, this “multi-sensory learning experience” has been put together “[u]sing the latest research in cognitive science and learning theory….”

How often have you heard someone say a computer programming book is “fun and entertaining”?

Yes, Head First HTML5 Programming is still a how-to book, and it is one that focuses on creating web apps using JavaScript — not exactly a fertile field for comedy.

But the book promises “to start by going from zero to HTML5 in 3.8 pages (flat)” — and delivers. By the third page, you begin using a whimsical “HTML5-O-Matic” to update standard HTML to HTML5. And by the bottom of the fourth page, you are “officially certified to upgrade any HTML to HTML5.”  (It takes just three steps and a bonus round to get there, by the way.)

Even the book’s table of contents is zany, amusing and informative, with funny graphics and snarky summaries of what you will find in each chapter and appendix. 

And don’t be intimidated by this book’s physical size. It has 574 pages, but it presents information in small, manageable chunks, surrounded by eye-pleasing white space and lots of illustrations that will make you grin or chuckle even as you learn something new.

By the way, you don’t have to know JavaScript to use this book. The first few chapters provide  an excellent and palatable JavaScript overview.

However, if you think you are serious about becoming an HTML5 programmer but don’t yet have any experience in  HTML markup and CSS  (cascading style sheets), the two writers recommend that you tackle one other book first: Head First HTML with CSS & XHTML (list price, $39.99 paperback. There is also a Kindle edition.)  

Whether you know HTML, CSS and JavaScript or not, however, you should plan on doing the book’s exercises. Cutting “class” is not an option with this book. “Some of (the exercises) are to help with memory, some are for understanding, and some will help you apply what you’ve learned,” the writers point out.

They add: “Most reference books don’t have retention and recall as a goal, but this book is about learning, so you’ll see some of the same concepts come up more than once.”

The software and hardware requirements for writing HTML5 and JavaScript code are minimal: “[Y]ou need a text editor, a browser, and, sometimes, a web server (it can be locally hosted on your personal desktop).”

They recommend that you use more than one browser while learning HTML5 and JavaScript. And, to use some HTML5 features and JavaScript APIs, you will have to “serve files from a real web server rather than loading a file….” But they explain how to do this.

Head First HTML5 Programming advertises that it will promises to help “load HTML5 and JavaScript straight into your brain,” and it seems to start doing that right after you open its pages — as long as you keep an open mind about using a programming book that is actually enjoyable and fun to read while it instructs.

Si Dunn