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

Advertisements

Programming C# 5.0 – Excellent how-to guide for experienced developers ready to learn C# – #bookreview

Programming C# 5.0
Ian Griffiths
(O’Reilly, paperbackKindle)

Ian Griffiths’ new book is for “experienced developers,” not for beginners hoping to learn the basics of programming while also learning C#. The focus is “Building Windows 8, Web, and Desktop Applications for the .NET 4.5 Framework.”

Earlier editions in the Programming C# series have “explained some basic concepts such as classes, polymorphism, and collections,” Griffiths notes. But C# also keeps growing in power and size, which means the page counts of its how-to manuals must keep growing, too, to cover “everything.”

The paperback version of Programming C# 5.0 weighs in at 861 pages and more than three pounds. So Griffiths’ choice to sharpen the book’s focus is a smart one. Beginners can learn the basics of programming in other books and other ways before digging into this edition. And experienced developers will find that the author’s explanations and code examples now have space to go “into rather more detail” than would have been possible if chapters explaining the basics of programming had been packed in, as well.

If you have done some programming and know a class from an array, this book can be your well-structured guide to learning C#. The “basics” are gone, but you still are shown how to create a “Hello World” program—primarily so you can see how new C# projects are created in Visual Studio, Microsoft’s development environment.

C# has been around since 2000 and “can be used for many kinds of applications, including websites, desktop applications, games, phone apps, and command-line utilities,” Griffiths says.

“The most significant new feature in C# 5.0,” he emphasizes, “is support for asynchronous programming.” He notes that “.NET has always offered asynchronous APIs (i.e., ones that do not wait for the operation they perform to finish before returning). Asynchrony is particularly important with input/output(I/O) operations, which can take a long time and often don’t require any active involvement from the CPU except at the start and end of an operation. Simple, synchronous APIs that do not return until the operation completes can be inefficient. They tie up a thread while waiting, which can cause suboptimal performance in servers, and they’re also unhelpful in client-side code, where they can make a user interface unresponsive.”

In the past, however, “the more efficient and flexible asynchronous APIs” have been “considerably harder to use than their synchronous counterparts. But now,” Griffiths points out, “if an asynchronous API conforms to a certain pattern, you can write C# code that looks almost as simple as the synchronous alternative would.”

If you are an experienced programmer hoping to add C# to your language skills, Ian Griffiths’ new book covers much of what you need to know, including how to use XAML (pronounced “zammel”) “to create  applications of the [touch-screen] style introduced by Windows 8” but also applications for desktop computers and Windows Phone.

Yes, Microsoft created C#, but there are other ways to run it, too, Griffiths adds.

“The open source Mono project (http://www.mono-project.com/) provides tools for building C# applications that run on Linux, Mac OS X, iOS, and Android.”

Si Dunn

For more information:  paperback – Kindle

Programming Google App Engine, 2nd Edition – An important how-to guide, updated – #programming #bookreview

Programming Google App Engine, 2nd Edition
Dan Sanderson
(O’Reilly,
paperbackKindle)

O’Reilly recently has published a new edition of Dan Sanderson’s Programing Google App Engine.  The new edition updates the 2009 first edition and includes coverage of Java 6 and Python 2.7 support, multithreading, asynchronous service APIs, and using frameworks such as webapp2 and Django 1.3. (“App Engine does not yet support Python 3,” Sanderson notes.)

The 509-page, 20-chapter book shows how “to develop applications that run on Google App Engine, and how to get the most out of the scalable model. A significant portion of the book discusses the App Engine scalable datastore, which does not behave like the relational databases that have been a staple of web development for the past decade,” the author states.

Sanderson is a technical writer and software engineer at Google, Inc. His new edition is well-written and appropriately illustrated with code samples, diagrams, screen shots and other graphics.

With clear steps and good detail, the book shows you first how to install and use the Python or Java SDKs on Mac OS X, Linux, and Windows machines and how to develop simple Python and Java applications. From there, it expands deeper into the how-to aspects of programming the Google App Engine.

In some chapters, the Python and Java options are presented together. Python’s and Java’s data modeling libraries, however, are discussed in separate chapters.

“Google App Engine, Google’s application hosting service, does more than just provide access to hardware,” Sanderson points out.

“It provides a model for building applications that grow automatically. App Engine runs your application so that each user to accesses it gets the same experience as every other user, whether there are dozens of simultaneous users or thousands. The application uses the same large-scale services that power Google’s applications for data storage and retrieval, caching, and network access. App Engine takes care of the tasks of large-scale computing, such as load balancing, data replication, and fault tolerance, automatically.”

Programming Google App Engine, 2nd Edition can take you from asking “What is Google App Engine?” to well down the road toward becoming an App Engine expert.

Si Dunn

For more information: paperbackKindle

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

Developing with Google+ –A handy how-to guide for working with the Google+ Platform – #programming #bookreview

Developing with Google+
Jennifer Murphy
(O’Reilly/Google Press, paperbackKindle)

Ready to integrate Google+ with an existing website? Eager to build your own Google+ social application? This well-written and nicely illustrated how-to guide can get you started.

Jennifer Murphy’s new book shows you, step by step, how to become “comfortable digging into Google+” and its application programming interface (API).

“The Google+ platform has three categories of features,” notes the author, who works at Google.

“The three categories of the Google+ platform are social plugins, like the +1 button, RESTful web services, which provide read access to Google+ data, and hangout applications, for writing your own real[-] time collaboration apps. Additionally, the RESTful web services can be used in a couple of ways. You can either access public data directly when you know what you’re looking for, or you can use OAuth2.0 to access your user’s data on Google+.”

The 91-page book is divided into six chapters that follow the progress of a fictional company ( humorously named “Baking Disasters”) as it adds all of the features of the Google+ platform to its website.

The chapters are:

  1. Introduction
  2. Social Plugins
  3. Public Data APIs
  4. OAuth-Enabled APIs
  5. Collaborative Baking with Hangout Apps
  6. Wrapping Up the Baked Goods

Depending on how experienced you are with developing on social platforms, the book is structured so you can easily skip around to the parts that are new to you. Or you can work through the processes one step and one chapter at a time.

Si Dunn

Get  more information here:  paperbackKindle

CouchDB and PHP Web Development Beginner’s Guide – #programming #bookreview

CouchDB and PHP Web Development Beginner’s Guide
Tim Juravich
(Packt Publishing, paperbackKindle)

CouchDB and PHP can be a formidable team when used to create web applications. 

“CouchDB is a database that completely embraces the web,” according to the Apache CouchDB website. Data is stored with JSON documents; documents can be accessed with a web browser via HTTP; and JavaScript can be used to “query, combine, and transform” documents. “You can even serve web apps directly out of CouchDB,” the site states.

Meanwhile, PHP is “a widely-used general-purpose scripting language that is especially suited for Web development and can be embedded into HTML,” its website notes.

The new CouchDB and PHP Web Development Beginner’s Guide by Tim Juravich is an excellent source for learning how to make the two packages work together. His focus, in the book, is on developing and honing skills by discovering “the ins and outs of building a simple but powerful website using CouchDB and PHP.”

After installing CouchDB and PHP, you learn how to create and enhance a simple, Twitter-like social network called “Verge.” It is an application that “will allow users to sign up, log in, and create posts,” the author states.

CouchDB and PHP Web Development Beginner’s Guide is available through Amazon, Barnes & Noble, and Safari, and also can be ordered direct from the Packt Publishing website in digital formats as well as print.

The book is packed with how-to steps and explanatory details. And it is organized into 10 well-defined chapters.

  • Chapter 1: Introduction to CouchDB
  • Chapter 2: Setting up your Development Environment
  • Chapter 3: Getting Started with CouchDB and Futon
  • Chapter 4: Starting Your Application
  • Chapter 5: Connecting Your Application to CouchDB
  • Chapter 6: Modeling Users
  • Chapter 7: User Profiles and Modeling Posts
  • Chapter 8: Using Design Documents for Views and Validation
  • Chapter 9: Adding Bells and Whistles to Your Application
  • Chapter 10: Deploying Your Application

A key strength of this book is its structure and use of focused headings. For example, when it is time to do something at your computer, there is a “Time for action” heading, such as: “Time for action – creating new databases in CouchDB.”

The step-by-step procedures that you then perform are laid out clearly in numbered order. And you get more than a brief description or illustration of what is supposed to happen. Juravich follows up with summary paragraphs labeled “What Just Happened?”  These summaries describe the purposes of the steps just performed and what they achieved.

Also, at the end of each chapter, he includes a helpful summary of the key points he has covered.

CouchDB and PHP Web Development Beginner’s Guide is well written and follows a classic and effective teaching model: “Tell them what you are going to tell them, tell them, and then tell them what you just told them.”

Its example code files can be downloaded from the Packt website or sent to you by email after you have registered with Packt.

The second chapter includes instructions for installing Apache, PHP, Git (for version control), and CouchDB on Windows, Linux and Mac OS X machines. But it is worth noting that the author restricts most of his discussions to the Mac OS X operating system (10.5 and later) and uses Mac OS command line statements “for simplicity and brevity.”

Windows and Linux users likely will have to do some command-line translations and work with files in different locations than described. Newbies with Windows or Linux machines should wait and gain more command-line experience first or find a mentor who knows both Mac OS X and Windows or Linux before tackling this book.

Maybe someone will write a similar CouchDB-PHP book for Windows and/or Linux users soon?

Si Dunn

FileMaker Pro 12: The Missing Manual – A big but easy how-to guide by two experts – #bookreview #database

FileMaker Pro 12: The Missing Manual
Susan Prosser and Stuart Gripman
(O’Reilly,
paperbackKindle)

The good news is: “FileMaker Pro is the ease-of-use champion.” It avoids common database “jargon words like query, join, and alias.” Instead, the two authors state, it uses “simple concepts like find, sort, and connect.”

So, if it’s so simple, why does this book weigh three pounds and have 924 pages?

Two reasons, both good. The authors – each are FileMaker Pro Certified Developers — do a fine job of explaining the package, from the basics to the most advanced features. And they illustrate their points with a generous number of screen shots, lists of steps, and other learning aids.

“FileMaker Pro databases,” they point out, “can be as simple as a list of the things you need to pack when you’re camping (complete with pictures!) or as complex as a company-wide system for purchasing, sales, inventory, invoicing, shipping, and customer tracking. But all of them essentially work the same way.”

FileMaker Pro 12: The Missing Manual has six parts, and the first two parts (encompassing four chapters and 172 pages) explain and demonstrate how to get started with the software and use it to build and improve your first database.

In Part 3, you move past the beginner stage and into creating and maintaining a relational database, plus handling such choices as field options, layout mechanics, calculations, and using scripts. In Part 4, you learn how to start thinking like a relational database developer and using FileMaker Pro Advanced. Part 5 focuses on database security and integration issues, including managing accounts, sharing databases over the Internet and sharing data with other systems. Part 6 contains four useful appendices, including definitions of FileMaker error codes.

In a powerful package like FileMaker Pro 12, there are plenty of choices and capabilities to explain, and there are few ways to be reasonably “complete” without ending up holding a big pile of how-to pages.

Despite its heft and thickness, however, this excellent Missing Manual is structured to help you move forward at your own pace — whether you want to learn it all or just enough to scrape by at a new workplace.

Si Dunn