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

Advertisements

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

Node: Up and Running – A fine intro to Node.js, the new 799-pound gorilla in the room – #programming #bookreview #in

Node: Up and Running
Tom Hughes-Croucher and Mike Wilson
(O’Reilly, paperback, list price $34.99; Kindle edition, list price $27.99)

Node.js is often described as “the dominant player” in the world of server-side JavaScript development. Whether that’s completely true or boastful hype, big players such as Google, LinkedIn, eBay, Walmart and Microsoft now are using it. And so are countless smaller players and startups. If Node.js is not yet King Kong, it has at least grown into a 799-pound, but reasonably tame, programming gorilla for those who want to write scalable server-side code using JavaScript.

In today’s weird, challenging job market for programmers, it would not hurt you to feed this new gorilla a few bananas and gain at least passing familiarity with it. You never know when you may need to ramp up some Node.js skills in a hurry, to get or keep a job or land a contract.

I like O’Reilly’s “Up and Running” book series for that very ramp-up reason. They do a good job of introducing a programming language and showing how to use key aspects of it. And they point you to additional resources for skills and knowledge you can pick up on the fly.

According to the two authors of Node: Up and Running,“Node.js is many things, but mostly it’s a way of running JavaScript outside the web browser.” They add: “Many people use the JavaScript programming language extensively for programming the interfaces of websites. Node.js allows this popular programming language to be applied in many more contexts, in particular on web servers. There are several notable features about Node.js that make it worthy of interest.”

For example: “Node is a wrapper around the high-performance V8 JavaScript runtime from the Google Chrome browser. Node tunes V8 to work better in contexts other than the browser, mostly by providing additional APIs that are optimized for specific use cases.”

The two authors point out that “JavaScript is an event-driven language, and Node uses this to its advantage to produce highly scalable servers. Using an architecture called an event loop, Node makes programming highly scalable servers both easy and safe.” Node.js also features non-blocking I/O.

Node.js “runs on Windows, Linux, Mac, and other POSIX OSes (such as Solaris and BSD),” the authors state. And this is the second Node book I’ve reviewed that claims the installation process is “extremely simple.” The previous book did not give enough information for beginners. This one follows “extremely simple” with instructions and screen displays spread across nearly four pages. But – a hurried beginner may miss this at first – the steps are only for those who choose to do a source install rather than use one of the Node.js installer links.

The first time I used a Windows link to install Node.js (trying to follow the previous book), I somehow ended up with stuff scattered and duplicated in several subdirectories  –. an “extremely simple” mess.)  This time, my installation did seem “simple,” if not quite “extremely simple.” (Once it completed, I had to go to a command prompt and run “node” rather than just click on a brand new Windows icon — my definition of “extremely simple.” )

Of course, you are expected to have some JavaScript knowledge and programming experience before tackling this book, so you may not want to get ahead of yourself on the learning curve. If you’re currently a JavaScript novice, put this one on the shelf for a little bit later. But definitely get it.

Node: Up and Running offers plenty of code examples, and the paragraphs between them are well-written and kept reasonably short. Thus, knowledge and skills can be gained in manageable small chunks. Only a few other illustrations are offered, and, unfortunately, they tend to be more goofy than helpful.

The 184-page book has eight chapters:

  1. A Very Brief Introduction to Node.js
  2. Doing Interesting Things
  3. Building Robust Node Applications
  4. Core APIs
  5. Helper APIs
  6. Data Access
  7. Important External Modules
  8. Extending Node

Some readers have noted that this book does not contain the traditional appendix giving links and referrals to other sources of more information on Node.js, and that’s a fair criticism. However, the book’s Chapter 6, “Data Access,” does have links to, and discussions of, “the basic ways to connect to common open source database choices and to store and retrieve data.” The topics covered include using Node.js with CouchDb, Redis, MongoDB and relational databases such as MySQL and PostgreSQL. The chapter also looks at connection pooling and message queuing (MQ) protocol.

“The Node project is still very young,” the two authors state, “and yet rarely have we seen such fervor around a project. Both novices and experts have coalesced around the project to use and contribute to Node, making it both a pleasure to explore and a supportive place to share and get advice.”

Their new book, Node: Up and Running, can help you get friendly fast with this new 799-pound gorilla in the room, Node.js.

— 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.

Droid X2: The Missing Manual – #droid #bookreview

Droid X2: The Missing Manual
By Preston Gralla
(O’Reilly, paperback, list price $19.99; Kindle edition, list price $9.99)

Got, getting or giving a Droid X2 smartphone?

Consider adding this useful how-to manual to the mix. Droid X2: The Missing Manual bills itself as “The book that should have been in the box.” But it’s likely much bigger than the phone’s box.

The 399-page manual, written by veteran technology writer Preston Gralla, is nicely structured, well-illustrated and chock full of information on using the Droid X2’s many features. The book is organized into six parts.

 Part 1 covers “Android Basics.” It gives a guided tour of features and shows how to make calls, do text messages, manage contacts, use Caller ID, make conference calls, and handle other tasks.

Part 2 focuses on “Camera, Pix, Music, and Video” and how you can use a Droid X2 to take photographs, play and manage music, and record, edit and view videos.

Part 3, “Maps, Apps, and Calendar,” shows “how to navigate using a GPS, to find any location in the world with maps, to find your own location on a map, to get weather and news, to use a great calendar app, and to synchronize that calendar with your Google calendar, or even an Outlook calendar,” Gralla writes.

Part 4, “Android Online,” discusses “everything you need to know about the Droid X2’s remarkable online talents.” This includes getting online over Verizon’s network or a wi-fi hotspot, using your Droid X2 as a portable G3 hotspot, checking email, surfing the Internet and downloading and using apps.

Part 5 covers “Advanced Topics,” including syncing and transferring files between a Droid X2 and a Mac or a PC, using your voice to control your Droid, and using your Droid at your workplace. Part 5 also includes a nice listing of Droid X2 settings.

Part 6, “Appendixes,” has three “reference chapters” showing how to activate a Droid X2, which accessories are available, and how to troubleshoot various issues.

This “Missing Manual” includes a link to a website where you can keep up with updates and changes to the Droid X2, plus corrections to the book.

Meanwhile, a “Missing CD” web page link provided in the book gives clickable links to the websites that are mentioned in the text.

Many new users of the Droid X2 likely will find this book helpful. So will experienced users who have mostly focused on voice calls and text messages and now want to master some of their smartphone’s other features. 

Si Dunn