THE RESPONSIVE WEB: A ‘mobile-first’ guide to creating websites effective for all devices – #bookreview

The Responsive Web

Matthew Carver

(Manning – paperback)

While devices for viewing websites keep getting smaller–web-enabled watches are a recent example–the challenges get bigger and tougher for website designers and developers. How do you create websites that effectively adjust to the size of the devices where they are being viewed, while also delivering essential information and links to the viewers?

“Responsive web design,” Matthew Carver writes in his excellent new book, “is a technique of designing websites that scale for various browsers, including mobile, tablet, and desktop. It’s made possible through CSS3 Media queries and offers developers the opportunity to design a site once for multiple devices. While the technique is seemingly simple, the practice itself involves several challenges.”

Carver’s book, The Responsive Web, goes well beyond simply showing and explaining a few web page templates. With clear text and excellent illustrations, the author offers numerous practical techniques and tips, and he provides the reasoning behind their importance, without wandering too deeply into web-design and user-experience theory.

This superior how-to book reflects Carver’s real-world experience as “an early adopter of responsive web design.” As a front-end designer, web developer and consultant, his clients have included such notables as American Airlines, the Dallas Morning News, Chobani, Home Depot, and Google.

The Responsive Web is divided into three parts, with a total of nine chapters.

Starting at Part One: The Responsive Way, Carver definitely does not dawdle. In the very first chapter, we are offered “all the basic information you need to get started with responsive web design.” Chapter 2, meanwhile, covers a key concept in Carver’s approach: “designing for mobile first” when creating responsive websites.

Part Two: Designing for the Responsive Web has four chapters built around “what goes into responsive web design from the visual designer’s and user-experience (UX) designer’s perspectives,” Carver writes, “but don’t think this information won’t apply to developers. There’s important stuff in here for everyone, and as this book teaches, web design requires collaboration.”

In Part Three: Expanding the Design with Code, the three final chapters cover some of the grittier details of responsive web design, including creating an effective page with HTML5 and CSS3, working with graphics, and using “progressive enhancement.” Carver notes: “With progressive enhancement you can create websites so that they function well in a variety of platforms, each with their own limitations and specifications.” And finally, he does not skip “testing and optimization.” The book’s final chapter is devoted to “the nitty gritty of optimizing your website for performance on every screen.”

In an intriguing appendix, Carver also discusses the processes and possibilities of introducing certain degrees of context awareness to websites. “What if, instead of resizing the design to adapt to the user’s device, you could also format parts of the site based on factors like location, time of day, the user’s history on the site, or the user’s activity level,” he points out. “Theoretically, all of this data is accessible to the design of a page and could be used to greatly enhance the user’s experience.”

Bottom line,  this is a very timely and useful guide for those who work with websites, as well as for those who manage web designers and developers.

Si Dunn

 

Advertisements

Learning Dart – A solid guide to basic development using Google’s Dart #programming language – #bookreview

Learning Dart

Learn how to program applications with Dart 1.0, a language specifically designed to produce better-structured, high performance applications 

Ivo Balbaert and Dzenan Ridjanovic

(Packt – Kindle, paperback)

 

The programming language Dart was introduced in late 2011 by Google as a potential replacement for aging JavaScript. But JavaScript, of course, has continued to spread all over the Internet and planet since it first appeared in 1995.

Not surprisingly, Google found itself getting some pushback from software developers and others who have a lot of time, education, sweat and money invested into creating, supporting and modernizing files that have .js extensions.

Dart today is billed as “a new platform for scalable web app engineering.” It is a long way from replacing JavaScript. Indeed, it compiles to JavaScript.

At the same time,  Dart is a good and powerful Open Source language. And, while it is not yet seen on most lists of top languages to know, it is gaining momentum and followers in the software world.

“Dart looks instantly familiar to the majority of today’s programmers coming from a Java, C#, or JavaScript/ActionScript background; you will feel at ease with Dart,” write the authors of Learning Dart.

“However, this does not mean it [Dart] is only a copy of what already exists; it takes the best features of the statically typed ‘Java-C#’ world and combines these with features more commonly found in dynamic languages such as JavaScript, Python, and Ruby. On the nimble, dynamic side[,] Dart allows rapid prototyping, evolving into a more structured development familiar to business app developers when application requirements become more complex.”

In their recent book,  Balbaert and Ridjanovic note this about Dart: “Its main emphasis lies on building complex (if necessary), high-performance, and scalable-rich client apps for the modern web.”

Likewise, they point out that  “Dart can also run independently on servers. Because Dart clients and servers can communicate through web sockets (a persistent connection that allows both parties to start sending data at any time), it is in fact an end-to-end solution. It is perfect on the frontend for developing web components with all the necessary application logic, nicely integrated with HTML5 and the browser document model (DOM).

“On the backend server side, it can be used to develop web services, for example, to access databases, or cloud solutions in Google App Engine or other cloud infrastructures. Moreover, it is ready to be used in the multicore world (remember, even your cell phone is multicore nowadays) because a Dart program can divide its work amongst any number of separate processes, called isolates, an actor-based concurrency model as in Erlang.”

Their well-written book, from Packt Publishing, delivers a structured and nicely paced overview of how to use the Dart programming language. The book is suited for inexperienced developers and experienced developers alike who are curious about, or ready to dig into, Dart .

The intended audience, the authors state, includes “…web application programmers, game developers, and other software engineers. Because of its dual focus (Dart and HTML5), the book can appeal to both web developers who want to learn a modern way of developing web applications, and to developers who seek guidance on how to use HTML5.”

Indeed, in the first chapter, you get more than the obligatory “Hello, World!” program. You also learn how to use the Eclipse-based Dart Editor to create some simple command-line and web applications.

From there, the 12-chapter work focuses on topics and software examples that range from variables, classes and libraries, to combining HTML forms with Dart, building games with HTML5 and Dart, developing business apps with Polymer web components, using Dart with MVC web and UI frameworks, working with local data and client-server communications, and creating data-driven web applications using Dart and MySQL or MongoDB.

I have tested some of the book’s code examples both on Linux and Windows machines and have enjoyed working with the Dart Editor. However, I did find a couple of code typos in the print version while hand-typing some of the shorter examples. The better choice is to download and use the book’s code examples found on the Packt website.

One other matter that some new Dartisans may encounter: Norton 360 antivirus software currently tends to throw dart.exe into quarantine on Windows machines–and that stops Dart cold. There is a fairly simple way to retrieve the file from quarantine and tell Norton 360 to let it run. However, check the Dart community page on Google+ for info on that and some other approaches to avoiding the problem.

Learning Dart was published soon after Dart 1.0 was released, and Dart has continued to evolve fairly quickly. (Its stable version was 1.4.3 at the time this was written.) So there will be some small differences in screen displays and other matters.

If you want to learn Dart and get up to speed for using it in application development, Learning Dart can be your handy and solid how-to guide.

Si Dunn

 ***

Ready to get Learning Dart? Click here: Kindlepaperback

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

Functional JavaScript – Applying functional techniques and Underscore.js – #programming #bookreview

Functional JavaScript
Introducing Functional Programming with Underscore.js
Michael Fogus
(O’Reilly – paperback, Kindle)

When I first started tinkering with JavaScript, object-oriented programming (OOP) was the rage, and JavaScript frequently was touted as one of the key object-oriented languages. After all, according to many online descriptions, almost everything within JavaScript “is OO.”

Now, in this enjoyable new book, JavaScript is hailed as a functional programming language. Of course, functional programming recently has been the rage in many programming circles. And “enjoyable” may seem an odd word to attach to a software text. Yet, it fits. Michael Fogus shows here that he is a technical writer who can be entertaining, effective and well-organized.

“This book,” he states, “is not about spewing dogma regarding the virtues of functional programming. I think there are many functional techniques that offer ways to rein in the complexities of software development, but I realize that at times, there are better ways to implement any given individual part.”

It is possible, of course, to debate object-oriented vs. functional JavaScript until the digital cows are called back home and put into infinite loops. But, for those who don’t know or care much about the differences, here are some basic views.

The Mozilla Developers Network (to simply pick  one example) discusses objected-oriented JavaScript on its site and declares: “Object-oriented programming may be seen as the design of software using a collection of cooperating objects, as opposed to a traditional view in which a program may be seen as a collection of functions, or simply as a list of instructions to the computer. In OOP, each object is capable of receiving messages, processing data, and sending messages to other objects. Each object can be viewed as an independent little machine with a distinct role or responsibility.”

Meanwhile, HaskellWiki offers this explanation of functional programming: “In functional programming, programs are executed by evaluating expressions, in contrast with imperative programming where programs are composed of statements which change global state when executed. Functional programming typically avoids using mutable state.

“Functional programming requires that functions are first-class, which means that they are treated like any other values and can be passed as arguments to other functions or be returned as a result of a function. Being first-class also means that it is possible to define and manipulate functions from within other functions.”

Some of the programming languages typically labeled “functional” include Clojure, OCaml, Erlang,  Haskell, Scala, and F#.

Here is how Michael Fogus defines functional programming:

“As a bare-bones introduction, functional programming can be described in a single sentence:

Functional programming is the use of functions that transform values into units of
abstraction, subsequently used to build software systems.

“This is a simplification bordering on libel,” he continues, “but it’s functional (ha!) for this early stage in the book. The library that I use as my medium of functional expression in JavaScript is Underscore, and for the most part, it adheres to this basic definition.”

(Underscore.js can be obtained from http://underscorejs.org and imported into “the applicable project directories.”)

Fogus refuses, in his text, “to create a false dichotomy and say that functional and object-oriented styles should stand in opposition.” Indeed, he notes that JavaScript supports both models and “systems can and should be composed of both models.”

He also points out that JavaScript can be used with other paradigms, including imperative programming, prototype-based object-oriented programming, and metaprogramming.

“In no way does this book represent even a modicum of original thinking regarding functional programming in JavaScript,” he states. Yet, it is a worthy effort.

It is well written, smoothly organized, and nicely illustrated with short code examples and helpful diagrams. And Fogus notes that JavaScript does have “[l]anguage oddities, unsafe features, and a sea of competing libraries” that raise concerns when it is selected for a project. Functional programming, he contends, can be one way to help ensure that JavaScript “can be not only safe, but also simple to understand and test, in addition to being proportionally scalable to the size of the code base.”

Here is the chapter lineup for Fogus’s 237-page book:

  • Chapter 1. Introducing Functional JavaScript
  • Chapter 2. First-Class Functions and Applicative Programming
  • Chapter 3. Variable Scope and Closures
  • Chapter 4. Higher-Order Functions
  • Chapter 5. Function-Building Functions
  • Chapter 6. Recursion
  • Chapter 7. Purity, Immutability, and Policies for Change
  • Chapter 8. Flow-Based Programming
  • Chapter 9. Programming without Class

Functional JavaScript is a winner on at least two counts: (1) as a how-to text for long-time JavaScript programmers wishing to learn more about functional programming; and (2) as a how-to text for long-time functional programmers desiring to learn more about JavaScript.

The book is not recommended for JavaScript newcomers who are still at the level of typing console.log(“The answer to everything in the universe is 42”). However, experienced beginners can learn from it, and so can those of us who just tinker with JavaScript periodically and use it mainly to work with Node.js, Backbone.js, Ember.js, CoffeeScript, HTML and other choices.

Si Dunn

Arduino Workshop – An excellent hands-on guide with 65 DIY projects – #arduino #bookreview

Arduino Workshop
A Hands-On Introduction with 65 Projects
John Boxall
(No Starch Press – paperback, Kindle)

If you’ve been wanting to tinker with a tiny Arduino computer, this excellent book can show you how to do much more than simply get started.

Indeed, John Boxall’s Arduino Workshop can keep you busy, challenged and intrigued for a long time as you work your way through basic electronics, basic Arduino programming, and a big selection of interesting and useful projects. The book’s instructions are written clearly, and they feature numerous close-up photographs, diagrams, screenshots, code listings, and other illustrations that can help you perform the how-to steps for each project.

The devices you can build with the open source Arduino microcomputer platform range from a battery tester for single-cell batteries to a GPS logger that records your travels and displays them on Google Maps. Some other examples include a digital thermometer that displays temperature changes on an LCD screen, a device that reads radio-frequency identification (RFID) tags, and a remote-controlled toy tank that you steer with an infrared TV remote. You can even create and program your own breadboard Arduino microcontroller using a handful of parts and Boxall’s instructions, diagrams, and photographs.

If that isn’t enough projects, the book also shows how to create a couple of games, plus an Arduino texter that sends your cell phone a text message when a particular event occurs. And you can rig up a simple Arduino device that will allow you to control its digital output pins by sending it a text message from your phone.

With Arduino projects, you not only do some computer programming (to create the “sketches” that control the microcomputer), you likewise learn to work with electronic components such as resistors, capacitors, LEDs and LCDs, oscillator crystals, voltage regulators, and other small parts and devices.

You also can meet and learn from other Arduino enthusiasts, Boxall notes in Arduino Workshop. “The Arduino project has grown exponentially since its introduction in 2005,” he writes. “It’s now a thriving industry, supported by a community of people united with the common bond of creating something new. You’ll find both individuals and groups, ranging from interest groups and clubs to local hackerspaces and educational institutions, all interested in toying with the Arduino.”

Si Dunn

The Modern Web: Multi-Device Web Development with HTML5, CSS3, and JavaScript – #bookreview

The Modern Web
Multi-Device Web Development with HTML5, CSS3, and JavaScript
Peter Gasston
(No Starch Press – Kindle, paperback)

After a quick first glance, you might look right past this book. You might assume its title, “The Modern Web,” simply introduces some kind of heavily footnoted, academic study of the Internet.

Not so, Web breath. In this case, it’s the subtitle that should grab your attention.

Whether you hope to go into web development, or you’re already there, Peter Gasston’s new book can help you get an improved grasp on three important, device-agnostic tools that will be essential to your work and career development. They are: HTML5, CSS3, and JavaScript, that not-so-simple programming language that many new web specialists often try to avoid learning. (That’s because, typically, it’s easier, more fun and a bit less cryptic to work with HTML5 and CSS3.)

Also, Gasston notes, there have been big explosions in the number of libraries and frameworks that use JavaScript, further clouding a developer’s ability to know which ones he or she should learn next. (The author limits his coverage to four: jQuery, YepNope, Modernizr, and Mustache.)

Gasston’s well-written book zeroes in on the three “web technologies that can be used anywhere, from open websites to device-specific web apps.” And on all sorts of devices, ranging from tiny phones to tablet computers to wall-covering HDTVs.

And his teaching aim is to show you “modern coding methods and techniques that you can use to build websites across multiple devices or that are tailored to the single device class you’re targeting.”

By the way, “websites” is simply a shorthand term the author uses “to avoid repetition. The features you’ll learn from this book are relevant to websites, web applications, [and] packaged HTML hybrid applications–in short, anything that can use HTML, CSS, and JavaScript.”

Gasston also wants you to learn that “fast” is the main thing that matters to those who will use your site. “Your site needs to be fast–and feel fast–regardless of the device it’s being displayed on,” he emphasizes. “And fast means not only technical performance (which is incredibly important) but also the responsiveness of the interface and how easily users can navigate the site and find what they need to complete the task that brought them to you in the first place.”

His 243-page book contains many short, useful code examples and illustrations, and is excellent for developers who have at least a little bit of experience with HTML5, CSS3, and JavaScript but aren’t sure where and how to focus their energies and attention for the rapidly changing career road ahead.

The Modern Web offers a well-organized introduction, plus 11 chapters:

  1. The Web Platform
  2. Structure and Semantics
  3. Device Responsive CSS
  4. New Approaches to CSS Layouts
  5. Modern JavaScript
  6. Device APIs
  7. Images and Graphics
  8. New Forms
  9. Multimedia
  10. Web Apps
  11. The Future

There also are two appendices: Browser Support as of March 2013 and Further Reading.

Peter Gasston has been a web developer for more than 12 years, and his previous book is The Book of CSS3.

He notes that “[t]he Web is constantly evolving, and book publishing means taking just a single snapshot of a moment. Some things will change; some will wither and be removed. I’ve tried to mitigate this by covering only technologies that are based on open standards rather than vendor-specific ones and that already have some level of implementation in browsers.”

He urges developers to stay alert to changing Web standards and to “be curious, be playful, keep on top of it all. He stresses: “There’s never been a more exciting time to work in web development, but you’ll need to put in an extra shift to really take advantage of it.”

Si Dunn

Kindle Fire HD: The Missing Manual, 2nd Edition – Covers new features, how-tos for 7-inch / 8.9-inch tablets – #bookreview

Kindle Fire HD: The Missing Manual, 2nd Edition
Peter Meyers
(O’Reilly – paperback, Kindle)

O’Reilly recently has brought out the second edition of Peter Meyers’ popular how-to guide for using the Kindle Fire HD multi-purpose tablet.

The new edition covers the 7-inch and 8.9-inch Kindle Fire models, but does not cover the original, first-generation Kindle Fire that was released in November, 2011. For details of how to use that model, get the first edition of Meyers’ book.

Many of us who own Kindles tend to have more than one version in the family: his, hers, and the kids’, for example. And we tend to use just a few of the features over and over–until we suddenly need or want to try another feature and aren’t sure how it works. So it can be good to have both editions of this book on your reference shelf (or in your Kindles).

The new edition includes how to use the front-facing video camera and microphone that were added to the 7-inch and 8.9-inch Fire HD models for video and audio chat capabilities. An HDMI port also is offered on the HD models, so you can hook up a cable and view a Kindle-stored video on a TV screen.

By  the way, if you enjoy audiobooks, they “are now full-fledged members of Team Sync” in the Kindle Fire HD world, the author notes. For example, if you buy a Kindle book and click the “Add Narration” button, you will also get the synchronized audiobook. (The button appears on your Fire’s screen, and the extra charge ranges from free to $3.95, depending on the book.) You can listen to the audiobook played on your Fire HD while driving to work, and then, when you’re ready to read quietly during your lunch break, you can pick up, in the text, right where you left off. The Kindle Fire HD now includes an Audible.com player, as well, and you can link an existing Audible.com account.

This well-written, richly illustrated Missing Manual definitely covers “the important stuff you need to know,” in a well-organized, easy-to-use format. It can help you get the most–and possibly more than you expected–from your Kindle Fire HD.

Si Dunn