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

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

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

The Data Journalism Handbook – Get new skills for a new career that’s actually in demand – #bookreview

The Data Journalism Handbook: How Journalists Can Use Data to Improve the News
Edited by Jonathan Gray, Liliana Bounegru, and Lucy Chambers
(O’Reilly, paperbackKindle)

Arise, ye downtrodden, unemployed newspaper and magazine writers and editors yearning to be working again as journalists. Data journalism apparently is hiring.

Data journalism? I didn’t know, either, until I read this intriguing and hopeful collection of essays, how-to reports, and case studies written by journalists now working as, or helping train, data journalists in the United States and other parts of the world.

Data journalism, according to Paul Bradshaw of Birmingham City University, combines “the traditional ‘nose for news’ and ability to tell a compelling story with the sheer scale and range of digital information now available.”

Traditional journalists should view that swelling tide of information not as a mind-numbing, overwhelming flood but ”as an opportunity,” says Mirko Lorenz of Deutsche Welle. “By using data, the job of journalists shifts its main focus from being the first ones to report to being the ones telling us what a certain development actually means.”

He adds: “Data journalists or data scientists… are already a sought-after group of employees, not only in the media. Companies and institutions around the world are looking for ‘sense makers’ and professionals who know how to dig through data and transform it into something tangible.”

So, how do you transform yourself from an ex-investigative reporter now working at a shoe store into a prizewinning data journalist?

A bit of training. And, a willingness to bend your stubborn brain in a few new directions, according to this excellent and eye-opening book.

Yes, you may still be able to use the inverted-pyramid writing style and the “five W’s and H” you learned in J-school. But more importantly, you will now need to show you have some good skills in (drum roll, please)…Microsoft Excel.

That’s it? No, not quite.

Google Docs, SQL, Python, Django, R, Ruby, Ruby on Rails, screen scrapers, graphics packages – these are just a few more of the working data journalists’ favorite things. Skills in some these, plus a journalism background, can help you become part of a team that finds, analyzes and presents information in a clear and graphical way.

 You may dig up and present accurate data that reveals, for example, how tax dollars are being wasted by a certain school official, or how crime has increased in a particular neighborhood, or how extended drought is causing high unemployment among those who rely on lakes or rivers for income.

You might burrow deep into publically accessible data and come up with a story that changes the course of a major election or alters national discourse.

Who are today’s leading practitioners of data journalism? The New York Times, the Texas Tribune, the Chicago Tribune, the BBC, Zeit Online, and numerous others are cited in this book.

The Data Journalism Handbook grew out of MozFest 2011 and is a project of the European Journalism Centre and the Open Knowledge Foundation.

This book can show you “how data can be either the course of data journalism or a tool with which the story is told—or both.”

If you are looking for new ways to use journalism skills that you thought were outmoded, The Data Journalism Handbook can give you both hope and a clear roadmap toward a possible new career.

Si Dunn

Google+: The Missing Manual – #bookreview

Google+: The Missing Manual
By Kevin Purdy
(O’Reilly, paperback, list price $14.99; Kindle edition, list price $11.99)

 I believe too much social media can rot the brain and waste many good hours of our lives. So, after I opened a Google+ account (mostly out of curiosity) a few weeks ago, I promptly let it sit unused.

I wasn’t sure what I could do with Google+ and how it might benefit me. Furthermore,  I felt that I was too busy to dig around on it, learn by blunder, and have to open a bunch of help screens and blog postings to try to find more information.

Most of all, I didn’t want to click or check the wrong box and start inviting hundreds of email contacts to join me on Google+. Particularly since there was absolutely nothing about me to see except one photo and a few bare words of “profile.”

Google+: The Missing Manual promises to deliver “the important stuff you need to know.” So I recently got a copy of it and gave Google+ another try.

Kevin Purdy’s book, I am pleased to say, is well-organized for beginners and is proving easy to follow as I gradually enlarge my Google+ beachhead.

I am still trying to figure out how to add Google+ efficiently and effectively to my online social life, as well as my writing and editing business. At this point, I still like Twitter much better. But that fact, likely, is because I have been using it for several years and have devoted a lot of time and effort to writing tweets, sharing links, retweeting information and following interesting people.

Kevin Purdy’s book now is helping me make some choices before I click on some of the Google+ setup links and go crashing off into the digital weeds.

Here is how it’s structured:

  • Chapter 1: Getting Started
  • Chapter 2: Managing Contacts with Circles
  • Chapter 3: Streams, Sharing, and Privacy
  • Chapter 4: Notifications
  • Chapter 5: Sharing Photos and Videos
  • Chapter 6: Hanging Out
  • Chapter 7: Searching and Sparks
  • Chapter 8: Google+ Mobile
  • Chapter 9: Playing Games

With the book’s help, I have ventured forth and tried a few things that I might otherwise have avoided or misunderstood. And I now have more features listed to try out during my next opportunities to spend time with Google+.

I am, frankly, still pondering if — or how deeply — I want to invest my social media time in Google+. But Purdy makes the compelling case that “Google+ is more than just a way to connect with friends, family, and acquaintances online. It’s a smarter way of sharing online that’s tied into all the other Google services you might already use”–such as Gmail and Google Docs.

And: “What Google+ really does differently…is give you nearly total control over who can see each thing you put on Google+, and what kinds things you see and from whom.”

I rate this book a well-written keeper (1) for anyone trying to get started on Google+ and (2) for anyone who, like me, has jumped into it and is now trying to figure it out, feature by feature, during busy days.

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

Code in the Cloud: Programming Google App Engine #bookreview

Code in the Cloud: Programming Google App Engine
Mark C. Chu-Carroll
(O’Reilly, $32.95, paperback)

 “O clouds, unfold!”
          –William Blake, “Milton,” preface

These days, it’s all about the cloud, many people insist.

Somewhere out there in “the cloud” are the servers and programs that you are now using — or soon will be. Much of  your data already is out there, too, and more will be.

But where, exactly? Why, floating in “the cloud,” of course.

“You don’t know where, and more importantly, you don’t care; there’s absolutely no reason for you to care,” insists Mark C. Chu-Carroll, a Google software engineer who has worked on programming languages and software development tools for nearly 20 years.

These “don’t care” and “it’s all in the cloud” notions expressed in Chu-Carroll’s well-written new book may make many long-time computer programmers nervous. This could be particularly true if you have spent a long time working with, and trying to secure the data on, personal computers or corporate networks of computers.

In the brave, new, vaporous world of cloud computing, there are almost no boundaries anymore. And many of the limitations and weaknesses of hardware, software and security can be more easily subdued, we are told.

So, what exactly is the cloud?

At one level, it is many clouds. You can think of huge data centers with many computers as individual clouds, and each data storage device within those centers as one water droplet that helps form that cloud. As individual clouds come in contact with each other, they bunch up into one bigger cloud and cover more and more of the sky.

In Mark C. Chu-Carroll’s view, the cloud is “a revolutionary way of thinking about computing; it’s a universe of servers that you can build an application on; it’s a world of services that you can build or that you can use to build other things.”

But when should you, as a programmer, use “the cloud”?

According to the author, “You can write almost any application you want in the cloud. In fact, many people strongly believe that everything should be in the cloud — that there’s no longer any reason to develop applications for standalone computers.”

He does not completely support that view and concedes that the cloud may not be “the ideal platform for everything.” 

Yet, when programming for the cloud, you can worry a lot less about what operating system you are running, what software you have, what hardware limitations you have and when you will need to do backups or do software and security upgrades.

“If you’re a user of the cloud,” Chu-Carroll writes, you buy access to the application you want and then connect to it from anywhere.”  And, when developing for the cloud, “you break things down to basic building blocks, buy those pieces from service providers, and put them together however you want to build a system.”

The cloud likely is here to stay, and it won’t be dissipating soon, just getting bigger. So, computer programmers of all types and persuasions need to pay close attention. It likely will become an increasingly important element in hiring and in securing contract work.

Mark C. Chu-Carroll’s Code in the Cloud can give you a solid introduction to cloud computing and also get you up to speed quickly on how to program applications using the Google App Engine. It starts out at the beginner’s level using Python and the Google App Engine to create a first, simple app. Then it moves quickly to Java and advanced Google App Engine topics.

This 306-page book is a new entry in O’Reilly’s popular “The Pragmatic Programmer” series. Here is its section and chapter lineup:

Section I – Getting Started with the Google App Engine
– Chapter 1: Introduction
– Chapter 2: Getting Started
Section II – Programming Google App Engine with Python
– Chapter 3: A First Real Cloud Application
– Chapter 4: Managing Data in the Cloud
– Chapter 5: Google App Engine Services for Login Authentication
– Chapter 6: Organizing Code: Separating UI and Logic
– Chapter 7: Making the UI Pretty: Templates and CSS
– Chapter 8: Getting Interactive
Section III – Programming Google App Engine with Java
– Chapter 9: Google App Engine and Java
– Chapter 10: Managing Server-Side Data
– Chapter 11: Building User Interfaces in Java
– Chapter 12: Building the Server Side of a Java Application
Section IV – Advanced Googe App Engine
– Chapter 13: Advanced Datastore: Property Types
– Chapter 14: Advanced Datastore: Queries and Indices
– Chapter 15: Google App Engine Services
– Chapter 16: Server Computing in the Cloud
– Chapter 17: Security in App Engine Services
– Chapter 18: Administering Your App Engine Deployment
– Chapter 19: Wrapping Up

A good index is included that enhances the book’s organization and ease of use.

Code in the Cloud does an excellent job of explaining what a cloud service is and how it is different from traditional applications. Cloud applications are easily scalable. You can program a cloud app that works only for one user on one computer. Or your app can be used by many millions of users who can access it, via the cloud, from thousands of computers. If you build applications for people who work together online, “[c]ollaboration is the cloud’s natural niche,” the author says.

Mark C. Chu-Carroll shows you: (1)  how to build applications as a cloud service; (2) how to employ the App Engine to manage persistent data in the cloud; (3) how to create dynamic and interactive user interfaces that will run in Web browers; (4) how to interact with other services available in the App Engine cloud; and (5) how to maintain and manage security in cloud-based Web applications.

With this book in your programmer’s library, you will not — to badly misquote the poet William Wordsworth — be left wandering lonely, outside the Google App Engine’s share of the cloud. 

 – Si Dunn