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

Creating Mobile Apps with jQuery Mobile – A good & wide-ranging how-to guide – #programming #bookreview

Creating Mobile Appls with jQuery Mobile
Shane Gliser
(Packt Publishing – paperback, Kindle)

The long tagline on the cover of Shane Gliser’s new book deftly sums up its contents:  “Learn to make practical, unique, real-world sites that span a variety of industries and technologies with the world’s most popular mobile development library.”

Gliser unabashedly describes himself as a jQuery “fanboy…if it’s officially jQuery, I love it.” He is an experienced mobile developer and blogger who operates Roughly Brilliant Digital Studios. He also has some background in mobile UX (user experience).

Both aspects of that background serve him well in his smoothly written, nicely illustrated how-to book that zeroes in on jQuery Mobile, a  “touch-optimized” web framework for smartphones and tablets.

You may be surprised when you extract the 234-page book’s code examples and related items and find that the ZIP file is almost 100MB in size. Gliser covers a lot of ground in his 10 chapters. And each chapter contains a project.

Still, what you don’t do in the first chapter, “Prototyping jQuery Mobile,” is work at a computer. In the true spirit of UX, Gliser has you start first with a pen and some 3×5 note cards. Your goal is to rough out some designs for a jQuery Mobile website for a new pizzeria.

Why the ancient technology? “We are more willing to simply throw out a drawing that took less than 30 seconds to create,” Gliser writes. Otherwise, it’s too easy to stay locked into one design while trying different ways to make its code work. And: “Actually sketching by hand uses a different part of the brain and unlocks our creative centers.”

Best of all, working first with paper sketches enables team members who are not coders to contribute some comments, suggestions, and corrections for the emerging design.

In Chapter 2, “A Mom-and-Pop Mobile Website,” you step over to your computer with the paper prototype in hand and start converting the final design “into an actual jQuery Mobile (jQM) site that acts responsively and looks unique.” You also begin building “a configurable server-side PHP template,” and you work with custom fonts, page curl effects using CSS, and other aspects of creating and optimizing a mobile site.

“Mobile is a very unforgiving environment,” Gliser cautions, “and some of the tips in this section will make more difference than any of the ‘best coding practices.’” Indeed,  he wants you to be aware of optimization “at the beginning. You are going to do some awesome work and I don’t want you or your stakeholders to think it’s any less awesome, or slow, or anything else because you didn’t know the tricks to squeeze the most performance out of your systems. It’s never too early to impress people with the performance of your creations.”

Chapter 3, “Analytics, Long forms, and Front-end Validation,” moves beyond “dynamically link[ing] directly into the native GPS systems of iOS and Android.” Instead, Gliser introduces how to work with Google static maps, Google Analytics, long and multi-page forms, and jQuery Validate. As for static maps, he says, “Remember to always approach things from the user’s perspective. It’s not always about doing the coolest thing we can.” Indeed, a static map may be all the user needs to decide whether to drive to a business, such as a pizzeria, or just call for delivery. And, as for Google Analytics: “Every website should have analytics. If not, it’s difficult to say how many people are hitting your site, if we’re getting people through our conversion funnels, or what pages are causing people to leave our site.”

Meanwhile, desktop users are familiar with (and frequently irritated by) long forms and multi-page forms. Lengthy forms can be real deal-breakers for users trying to negotiate them on mobile devices. The author presents some ways to shorten long forms and break them “into several pages using jQuery Mobile.” And he emphasizes the importance of using the jQuery Validate plug-in to add validation to any page that has a form, so the user can see quickly and clearly that an entry has a problem.

The focus in Chapter 4, “QR Codes, Geolocation, Google Maps API, and HTML5 Video,” is on handling concepts that can be “applied to any business that has multiple physical locations.” Gliser uses a local movie theater chain as his development example. A site is created that makes use of QR codes, geolocation, Google Maps, and linking to YouTube movie previews. Then, he shows how to use embedded video to keep users on the movie chain’s site rather than sending them off to YouTube.

In Chapter 5, the goal is “to create an aggregating news site based off social media.” So the emphasis shifts to “Client-side Templating, JSON APIs, and HTML5 Web Storage.” Notes Gliser: “Honestly, from a purely pragmatic perspective, I believe that the template is the perfect place for code. The more flexible, the better. JSON holds the data and the templates are used to transform it. To draw a parallel, XML is the data format and XSL templates are used to transform. Nobody whines about logic in XSL; so I don’t see why it should be a problem in JS templates.”

Next, he shows how to patch into Twitter’s JSON API to get “the very latest set of trending topics” and “whittle down the response to only the part we want…and pass that array into JsRender for…well…rendering” in a manner that will be “a lot cleaner to read and maintain” than looping through JSON and using string concatenation to make the output.

Other topics in Chapter 5 include programmatically changing pages in jQuery Mobile, understanding how jQuery Mobile handles generated pages and Document Object Model (DOM) weight management, and working with RSS feeds. Gliser points out that there is still “a lot more information out there being fed by RSS feeds than by JSON feeds.” The chapter concludes with looks at how to use HTML5 web storage (it’s simple, yet it can get “especially tricky on mobile browsers”), and how to leverage the Google Feed API. Says Gliser: “The Google Feeds [sic] API can be fed several options, but at its core, it’s a way to specify an RSS or ATOM feed and get back a JSON representation.”

Chapter 6 jumps into “the music scene. We’re going to take the jQuery Mobile interface and turn it into a media player, artist showcase, and information hub that can be saved to people’s home screens,” Gliser writes. He proceeds to show how “ridiculously simple it can be to bring audio into your jQuery Mobile pages.” And he explains how to use HTML5 manifest “and a few other meta tags” to save an app to the home screen. Furthermore, he discusses how to test mobile sites using “Google Chrome (since its WebKit) or IE9 (for the Windows Phone)” as browsers that are shrunken down to mobile size. “Naturally, this does not substitute for real testing,” he cautions. “Always check your creations on real devices. That being said, the shrunken browser approach will usually get you 97.5 percent of the way there. Well…HTML5 Audio throws that operating model right out the window.”

Since “mobile phones are quickly becoming our photo albums,” Gliser’s Chapter 7, “Fully Responsive Photography,” shows first how to create a basic gallery using Photoswipe. Then, in a section focused on “supporting the full range of device sizes,” he explains how to start using responsive web design (RWD), “the concept of making a single page work for every device size.” The issues, of course, range from image sizes and resolutions to text sizes and character counts per line, on screens as small as smart phones and tablets, or larger.

In Chapter 8, “Integrating jQuery Mobile into Existing Sites,” three topics are key: (1) “Detecting mobile – server-side, client-side, and the combination of the two”; (2) “Mobilizing full site pages – the hard way”; and (3) Mobilizing full site pages – the easy way.” Gliser avoids some potential “geek war” controversies over “browser sniffing versus feature detection” when detecting mobile devices. He zeroes in first on detection using WURFL for “server-side database-driven browser sniffing.” He also shows how to do JavaScript-based browser sniffing, which he concedes may be “the worst possible way to detect mobile but it does have its virtues,” especially if your budget is small and you want to exclude older devices that can’t handle some new JavaScript templating. He also describes JavaScript-based feature detection using Modernizer and some other feature-detection methods.

As for mobilizing full-site pages “the hard way,” he states that there is really “only one good reason: to keep the content on the same page so that the user doesn’t have one page for mobile and one page for desktop. When emails and tweets and such are flying around, the user generally doesn’t care if  they’re sending out the mobile view or the desktop view and they shouldn’t.” He focuses on how “it’s pretty easy to tell what parts of a site would translate to mobile” and how to add data attributes to existing tags “to mobilize them. When jQuery’s libraries are not present on the page, these attributes will simply sit there and cause no harm. Then you can use one of our many detection techniques to decide when to throw the jQM libraries in.”

Mobilizing full-size pages “the easy way” involves, in his view, “nothing easier and cleaner than just creating a standalone jQuery Mobile page…and simply import the page we want with AJAX. We can then pull out the parts we want and leave the rest.” His code samples show how to do this.

Chapter 9, “Content Management Systems and jQM” looks at the pros and cons of using three different content management systems (CMS) with jQuery Mobile: WordPress, Drupal, and Adobe Experience Manager. “The key to get up and running quickly with any CMS is, realizing which plugins and themes to use,” Gliser writes.  He also explains how to use mobile theme switchers.

Drupal offers some standard plugins that provide contact forms, CAPTCHA, and custom database tables and forms, and enable you to “create full blown web apps, not just brochureware sites,” he notes. But: “The biggest downside to Drupal is that it has a bit of a learning curve if you want to tap its true power, Also, without some tuning, it can be a little slow and can really bloat your page’s code.” .

As for Adobe Experience Manager (AEM), Gliser merely introduces it as a “premier corporate CMS” and a “major CMS player that comes with complete jQuery Mobile examples.” He doesn’t show “how to install, configure, or code for AEM. That’s a subject for several training manuals the size of this book.”

Chapter 10, the final chapter, is titled “Putting It All Together — Flood.FM.” Using what you’ve learned in the book (including prototyping the interfaces on paper first), you create “a website where listeners will be greeted with music from local, independent bands across several genres and geographic regions.” Along the way, Gliser introduces Balsamiq, “a very popular UX tool for rapid prototyping.” He discusses using Model-View-Controller (MVC), Model-View-ViewModel (MVVM), and Model-View-Whatever (MV*) development structures with jQuery Mobile. He shows how to work with the Web Audio API , and he illustrates how to prompt users to download the Flood.FM app to their home screens. He finishes up with brief discussions of accelerometers, cameras, “APIs on the horizon,” plus “To app or not to app, that is the question” and whether you should compile an app or not. Finally, he shows PhoneGap Build, the “cloud-based build service for PhoneGap.”

Bottom line: Shane Gliser’s book covers a lot of  useful ground for those who are ready to learn jQuery Mobile.

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

Building Web, Cloud, & Mobile Solutions with F# – #programming #bookreview

Building Web, Cloud, & Mobile Solutions with F#
Daniel Mohl
(O’Reilly – paperback, Kindle)

F# (pronounced “F-sharp”) is a relatively new functional, open-source programming language developed by Microsoft and the F# Software Foundation. F# can be used to create scalable applications with ASP.NET MVC 4, ASP.NET Web API, Windows Communication Foundation (WCF), Windows Azure, HTML5, Web Sockets, CSS3, jQuery Mobile, and other tools.

Daniel Mohl’s Building Web, Cloud, & Mobile Solutions with F# is a well-written guide to “everything you need to know to start building web, cloud, and mobile solutions with F#.” Mohl also give some how-to examples using a range of technologies, libraries, and platforms, including SignalR, CouchDB, RavenDB, MongoDB, and others.

Mohl says his book is “intended for technologists with experience in .NET who have heard about the benefits of F#, have a cursory understanding of the basic syntax, and wish to learn how to combine F# with other technologies to build better web, cloud, and mobile solutions.”

In other words, this should not be your first book about F# or the relevant technologies that also are covered. Mohl recommends Chris Smith’s Programming F#, 3.0 as a first step toward learning the language.

In its 160 pages, Building Web, Cloud, & Mobile Solutions with F# offers five chapters, three appendices, and a number of code samples and screen shots. The chapters and appendices are:

  • 1. Building an ASP.NET MVC 4 Web Application with F#
  • 2. Creating Web Services with F#
  • 3. To the Cloud! Taking Advantage of Azure
  • 4. Constructing Scalable Web and Mobile Solutions
  • 5. Functional Frontend Development
  • Appendix A: Useful Tools and Libraries
  • Appendix B: Useful Websites
  • Appendix C: Client-Site Technologies That Go Well with F#

Mohl’s text also contains numerous links to important and useful websites.

He notes that “the primary focus of this book is on how to use F# to best complement the larger technology stack”, so he spends “a lot more time talking about controllers and models than views. F# provides several unique features that lend themselves well to the creation of various aspects of controllers and models.”

Si Dunn

HTML5 and JavaScript Web Apps – With emphasis on the Mobile Web – #programming #bookreview

HTML5 and JavaScript Web Apps
Wesley Hales
(O’Reilly,
paperbackKindle)

Increasingly, the world of Web development is taking on a “mobile first” attitude. And for good reason. Sales of desktop and laptop computers are shrinking, while sales of mobile devices seem to be swelling into a flood.

“Consumers are on track to buy one billion HTML5-capable mobile devices in 2013,” Wesley Hales writes in his new book. “Today, half of US adults own smartphones. This comprises 150 million people, and 28% of those consider mobile their primary way of accessing the Web. The ground swell of support for HTML5 applications over native ones is here, and today’s developers are flipping their priorities to put mobile development first.”

Hales’ HTML5 and JavaScript Web Apps focuses on using HTML5, JavaScript, and the latest W3C specifications to create mobile and desktop web apps that can work on a wide range of browsers and devices.

Indeed, deciding what to support is a key point in this useful, well-focused how-to guide. Hales notes: “Unfortunately the Mobile Web isn’t write-once-run-anywhere yet. As specifications become final and features are implemented, interoperability will be achieved. In today’s world of mobile browsers, however, we don’t have a largely consistent implementation across all browsers. Even though new tablets and phones are constantly being released to achieve a consistent level of HTML5 implementation, we all know that we’re [also] stuck with supporting the older, fragmented devices for a set amount of time.”

The 156-page book straddles “the gap between the Web and the Mobile Web” but puts a lot of emphasis on developing mobile applications. Here are its nine chapters:

  1. Client-Side Architecture
  2. The Mobile Web
  3. Building for the Mobile Web
  4. The Desktop Web
  5. WebSockets
  6. Optimizing with Web Storage
  7. Geolocation
  8. Device Orientation API
  9. Web Workers

This is not a book for JavaScript, HTML, or CSS beginners. But if you have at least some basic experience with Web application development, Hales can help you get on track toward becoming a Mobile Web guru. Meanwhile, if you are already well-versed in the ways of the Web app world, you may still learn some new and useful things from HTML5 and JavaScript Web Apps.

Si Dunn

JavaScript as Compilation Target: ClojureScript and Dart – #programming #bookreview

Despite its widespread success, JavaScript has a reputation for being a computer language with many flaws. Still, it is now everywhere on the planet, so it is here to stay, very likely for a long, long time.

Not surprisingly, several new languages have emerged that jump over some of JavaScript’s hurdles, offer improved capabilities, and also compile to optimized JavaScript code.

Two of these languages are the focus of noteworthy new “Up and Running” books from O’Reilly: ClojureScript: Up and Running and Dart: Up and Running.

Here are short reviews of each book:

ClojureScript: Up and Running
Stuart Sierra and Luke VanderHart
(O’Reilly, paperback, Kindle)

ClojureScript, the authors contend, “provides developers with a language that is more powerful than JavaScript, which can reach all the same places JavaScript can, with fewer of JavaScript’s shortcomings.”

The primary targets of ClojureScript are “web browser applications, but it is also applicable to any environment where JavaScript is the only programmable technology available,” they add.

“ClojureScript is more than Clojure syntax layered on top of JavaScript: it supports the full semantics of the Clojure language, including immutable data structures, lazy sequences, first-class functions, and macros,” they emphasize.

Their 100-page book focuses on how to use ClojureScript’s features, starting at the “Hello world” level and gradually advancing to “Development Process and Workflow” and “Integrating with Clojure.” (ClojureScript is designed for building client-side applications, but it can be merged with Clojure on the JVM to create client-server applications.)

Early in the book, they also describe how to compile a ClojureScript file to JavaScript and emit code “that is fully compatible with the Advanced Optimizations mode of the Google Closure Compiler.”

The two writers are Clojure/ClojureScript developers with a previous book to their credit.

ClojureScript: Up and Running is written well and appropriately illustrated with code samples, flow charts, and other diagrams. The authors recommend using the Leiningen build system for Clojure, plus the lein-cljsbuild plug-in for ClojureScript.

Their book is a smooth introduction to ClojureScript that requires no prior knowledge of Clojure. But you do need a basic working knowledge of JavaScript, HTML, CSS, and the Document Object Model (DOM).

#

Dart: Up and Running
Kathy Walrath and Seth Ladd
(O’Reilly, paperback, Kindle)

Google created Dart to be “an open-source, batteries-included developer platform for building structured HTML5 web apps,” the two authors note.

Dart provides not only a new language, but libraries, an editor, a virtual machine (VM), a browser that can run Dart apps natively, and a compiler to JavaScript.”

Indeed, Dart looks very similar to JavaScript and is “easy to learn,” the two writers state. “A wide range of developers can learn Dart quickly. It’s an object-oriented language with classes, single inheritance, lexical scope, top-level functions, and a familiar syntax. Most developers are up and running with Dart in just a few hours.”

The authors work at Google and note that some of the software engineers who helped develop the V8 JavaScript engine that is “responsible for much of Chrome’s speed” are now “working on the Dart project.”

Dart has been designed to scale from simple scripts all the way up to complex apps, and it can run on both the client and the server.

Those who choose to code with Dart are urged to download the open-source Dart Editor tool, because it also comes with a “Dart-to-JavaScript compiler and a version of Chromium (nicknamed Dartium) that includes the Dart VM.”

Since Dart is new, the writers also urge readers to keep an eye periodically on the Dart website and on their book’s GitHub site, where code can be downloaded and errors and corrections noted.

Dart: Up and Running is a well-structured, well-written how-to book, nicely fortified with short code examples and other illustrations. While the book appears very approachable and simple, it is not for complete beginners. You should have a basic working knowledge of JavaScript, HTML, CSS, and the Document Object Model (DOM).

If you are looking for a web development language that matches JavaScript’s dynamic nature but also addresses JavaScript’s sometimes-aggravating shortcomings, consider trying Dart—with this book in hand.

Si Dunn

Adobe Edge Animate: The Missing Manual – #bookreview

Adobe Edge Animate: The Missing Manual
Chris Grover
(O’Reilly, paperbackKindle)

Chris Grover’s well-written and updated new book shows you how to build animated HTML 5 graphics for the iPhone, the iPad, and the Web, using familiar Adobe features. By the sixth page of the first chapter, you are using the software to begin creating your first animation.

The previous edition of this book, covering Adobe Edge Animate Preview 7, was released just two months ago, shortly before Adobe released the 1.0 commercial version of its Edge Animate product. This new edition has been updated and expanded to cover the commercial version.

Prior to the 1.0 release, seven Preview versions of Adobe Edge Animate had been issued as free downloads, and user feedback was gathered so the product could be enhanced and expanded.

Here is what I reported about this book’s Preview 7 edition in an  October, 2012, review:

First, this book can help you get started with the 1.0 commercial version of Adobe Edge Animate. Second, O’Reilly will soon bring out an Adobe Edge Animate “Missing Manual” that covers the new commercial release. And, third, sources at O’Reilly tell me that readers who purchase this Preview 7 edition of Chris Grover’s book will get access to “the e-book version of Adobe Edge Animate the 1.0 version and all of its updates.”

The new edition of Adobe Edge Animate: The Missing Manual has ten chapters organized into five parts, even though page xiv of the paperback version states that the book is “divided into three parts.” (It then lists four parts, instead of  five, or three).  The new part in this edition is titled “Publishing Animate Compositions” and focuses on “Publishing Responsive Web Pages” that will look good “in web browsers of all shapes and sizes….” Here are the new edition’s parts and chapters:

Part One:Working with the Stage

  • Chapter 1: Introducing Adobe Edge Animate
  • Chapter 2: Creating and Animating Art
  • Chapter 3: Adding and Formatting Text

Part Two: Animation with Edge Animate

  • Chapter 4: Learning Timeline and Transition Techniques
  • Chapter 5: Triggering Actions
  • Chapter 6: Working Smart with Symbols

Part Three: Edge Animate with HTML 5 and JavaScript

  • Chapter 7: Working with Basic HTML and CSS
  • Chapter 8: Controlling Your Animations with JavaScript and jQuery
  • Chapter 9: Helpful JavaScript Tricks

Part Four: Publishing Your Composition

  • Chapter 10: Publishing Responsive Web Pages

Part Five: Appendixes

  • Appendix A: Installation and Help
  • Appendix B: Menu by Menu

Where keystrokes are appropriate, Chris Grover lists both and does not make you have to translate between systems, as some how-to manuals do.

“Animate works almost precisely the same in its Macintosh and Windows versions,” he assures. “Every button in every dialog box is exactly the same; the software response to ever command is identical. In this book, the illustrations have been given even-handed treatment, rotating between the two operating systems where Animate is at home (Windows 7 and Mac OS X).”

Si Dunn

For more information: (O’Reilly, paperback, Kindle)

Learning Node – A good how-to guide for server-side Web development with Node.js – #programming #bookreview

Learning Node
Shelley Powers
(O’Reilly, paperbackKindle)

 “Node is designed to be used for [server-side] applications that are heavy on input/output (I/O), but light on computation,” veteran Web technology author Shelley Powers notes in Learning Node, her ninth and newest how-to book from O’Reilly.

“Node.js,” she explains, “is a server-side technology that’s based on Google’s V8 JavaScript engine. It’s a highly scalable system that uses asynchronous, event-driven I/O (input/output), rather than threads or separate processes. “It’s ideal for web applications that are frequently accessed but computationally simple.”

I’ve criticized some previous Node books (1) for assuming that all of their readers know a lot about Node.js and assorted programming languages and (2) for not giving enough step-by-step installation and start-up information.

Happily, Learning Node is well written, nicely illustrated with code samples and screen shots, and assumes only that you have some working familiarity with JavaScript. It gives a detailed overview of how to set up development environments in Linux (Ubuntu) and Windows 7. “Installation on a Mac should be similar to installation on Linux,” the author adds.

One caveat regarding code examples: “Most were tested in a Linux environment, but should work, as is, in any Node environment.”

The 374-page book has 16 chapters. The first five “cover both getting Node and the package manager (npm) installed , how to use them, creating your first applications, and utilizing modules.”

Shelley Powers notes that she incorporates “the use of the Express framework, which also utilizes the Connect middleware, throughout the book.” So if you have little or no experience with Express, you will need to pay attention to chapters 6 through 8. But: “After these foundation chapters, you can skip around a bit,” she adds.

Some of the additional chapters cover key/value pairs, using MongoDb with Node, and working with Node’s relational database bindings.

Two chapters get into specialized application use. “Chapter 12 focuses purely on graphics and media access, including how to provide media for the new HTML5 video element, as well as working with PDF documents and Canvas,” the author points out. “Chapter 13 covers the very popular Sockets.io module, especially for working with the new web socket functionality.”

The final chapters are crucial, particularly if you want to move from learning Node to working in a production environment. Chapter 14 covers “Testing and Debugging Node Applications.” Chapter 15 “covers issues of security and authority…it is essential that you spend time in this chapter before you roll a Node application out for general use.”

Meanwhile, Chapter 16 describes “how to prepare your application for production use, including how to deploy your Node application not only on your own system , but also in one of the cloud servers that are popping up to host Node applications.”

Learning Node is both an excellent overall introduction to Node.js and a how-to reference guide that you will want to keep close at hand as you develop and deploy Node applications.

Si Dunn

For more information: Node.js, paperback, Kindle