Mac Hacks – More than 50 ways to unlock the power of OS X – #apple #mac #bookreview

Mac Hacks
Tips & Tools for Unlocking the Power of OS X
Chris Seibold
(O’Reilly – paperback, Kindle)

Many people buy Apple’s Macintosh computers precisely because they do not want to have to mess with their machines. They just want to open a specific app, use it, close it and move on to the other things in their lives.

But many other users want to dive inside their Macs. They want to tinker with how it works, change settings for greater efficiency or utility, and know all that they can know about taking control and making their machine do new tricks and handle new tasks.

Mac Hacks is a fine and useful guidebook for anyone who isn’t afraid to change default settings or bring up a cursor at a command-line interface. It is also an excellent how-to guide if you want to learn how to make OS X on your Mac work better for your needs.

Author Chris Seibold wisely launches his book with a caution: “Hacking is fun and productive, but it can also introduce an element of danger….” And he starts at the very basics of hacking: carefully backing up your files before you start driving your Mac off its familiar, well-beaten paths. “With a good backup,” he writes, “you don’t start over, you simply restore. Without a good backup, well, good luck….” Indeed, his first “quick hack” shows how to change the default one-hour time-interval setting for the Mac’s Time Machine backup utility, so you can back up sooner (or later).

Seibold’s 11-chapter book contains 51 hacks that range from creating a bootable flash drive to learning how to use “the Unix side of your Mac” and putting your iTunes library on a separate disk. He also offers several more “quick hacks,” including how to copy the Mac’s Recovery partition to a Flash drive, so it can be available if your Mac’s hard drive fails.

Some of the book’s hacks have been provided by respected “guest hackers.”  But Seibold himself is no slouch at Mac hacking. He has written two other books for O’Reilly: the Big Book of Apple Hacks and the Mac OS X Lion Pocket Guide.

Si Dunn

Advertisements

Jump Start Sinatra – With this book and a little Ruby, you can make Sinatra sing – #programming #bookreview

Jump Start Sinatra
Get Up to Speed with Sinatra in a Weekend
Darren Jones
(SitePoint – Kindle, Paperback)

Many Ruby developers love Rails for its power and capabilities as a model-view-controller (MVC) framework. But some of them don’t like Rails’ size, complexity, and learning curve.

Meanwhile, many other Rubyists love Sinatra for its simplicity and ease of learning, plus its ability “to create a fully functional web app in just one file,” says Darren Jones in his new book, Jump Start Sinatra. “There are no complicated setup procedures or configuration to worry about. You can just open up a text editor and get started with minimal effort, leaving you to focus on the needs of your application.”

Jones does not temper his enthusiasm for Sinatra, adding that “there isn’t a single line of bloat anywhere in its source code, which weighs in at fewer than 2,000 lines!”

His 150-page book covers a lot of ground, from downloading and installing Sinatra to building websites, working with SQLite, Heroku, Rack, jQuery, and Git, and even using some CoffeeScript (to avoid “getting our hands dirty writing JavaScript…”). He also shows how to create modular Sinatra applications that use separate classes.

“Sinatra makes it easy–trivial almost–to build sites, services, and web apps using Ruby,” the author states. “A Sinatra application is basically made up of one or more Ruby files. You don’t need to be an expert Rubyist to use Sinatra, but the more Ruby you know, the better you’ll be at building Sinatra apps.”

Jones adds: “Unlike Ruby on Rails, Sinatra is definitely not a framework. It’s without conventions and imposes no file structure on you whatsoever. Sinatra apps are basically just Ruby programs; what Sinatra does is connect them to the Web. Rather than hide behind lots of magic, it exposes the way the Web works by making the key concepts of HTTP verbs and URLs an explicit part of it.”

Jump Start Sinatra is a well-written, appropriately illustrated guide to getting started with this popular free software. Ruby newcomers may wish for a few more how-to steps or code examples. But the counter argument is, if you’re brand-new to Ruby, save Sinatra for later; focus on getting learning Ruby first. 

Darren Jones does not buy into a common assessment that’s often heard when developers are asked their views of Rails vs. Sinatra. “Opinions abound that Sinatra can only be used for small applications or simple APIs, but this simply isn’t true,” he argues. “”While it is a perfect fit for these tasks, Sinatra also scales impressively, demonstrated by the fact that it’s been used to power some big production sites.”

Some of those “big production sites,” according to Wikipedia, include such notables as Apple, LinkedIn, the BBC, the British government, Heroku, and GitHub.

Si Dunn

Lean Analytics and Lean UX – Two new guides to better business and user experiences – #bookreview

Okay, how are we leaning today? Leaning in? Leaning back? Leaning to the left or right? Leaning over? Or just leaning toward chucking all “hot new” postures that supposedly help us pose ourselves for career success?

Here’s some good news. None of the above leanings are topics in two new books from O’Reilly’s popular “Lean” series, edited by Eric Ries.

Lean Analytics deals with using data to help you determine if there is a profitable need for the product or service you hope to offer with a startup business. Lean UX, meanwhile, deals with the process of designing a better user experience (UX) for a company’s apps, website or other products.  Here are short reviews of each book:

Lean Analytics
Use Data to Build a Better Startup Faster
Alistair Croll and Benjamin Yoskovitz
(O’Reilly – hardback, Kindle)

“Entrepreneurs,” the authors state, “are particularly good at lying to themselves. Lying may even be a prerequisite for succeeding as an entrepreneur–after all, you need to convince others that something is true in the absence of good, hard evidence. You need believers to take a leap of faith with you. As an entrepreneur, you need to live in a semi-delusional state just to survive the inevitable rollercoaster ride of running your startup.”

But…you also need cold, hard data. And what you learn from that data may not mesh well with the lie you are living as you try to start a new business from scratch. Yet, it may save you from failing and wasting a lot of money.

“Your delusions,” the authors argue, “no matter how convincing, will wither under the harsh light of data. Analytics is the necessary counterweight to lying, the yin to the yang of hyperbole. Moreover, data-driven learning is the cornerstone of success in startups. It’s how you learn what’s working and iterate toward the right product and market before the money runs out.”

Lean Analytics builds on the Lean Startup process developed by Eric Ries. In today’s digital world, the authors explain, “[w]e’re in the midst of a fundamental shift in how companies are built. It’s vanishingly cheap to create the first version of something. Clouds are free. Social media is free. Competitive research is free. Even billing and transactions are free.”

Taken together, these facilities mean “you can build something, measure its effect, and learn from it to build something better next time. You can iterate quickly, deciding early on if you should double down on your idea or fold and move on to the next one.”

Their 409-page book is not quick reading. But it deserves attention and study, whether you want to start a business, already have started a business, or hope to revamp and improve a business that has been in operation for some time. Lean Analytics presents many examples and case studies that illustrate how you can gather and analyze existing data, then test products or services to determine if they are something that customers actually need, want and will use.

With new data from the tests and the ability to continue testing, you can modify your product or service and focus more resources, energy, and time on improving and refining what will work best for your customers–and your bottom line.

***

Lean UX
Applying Lean Principles to Improve User Experience
Jeff Gothelf with Josh Seiden
(O’Reilly – hardback, Kindle)

“Lean UX is a collaborative process,” the two authors of this book emphasize. “It brings designers and non-designers together in co-creation. It yields ideas that are bigger than those of the individual contributors. But it’s not design-by-committee. Instead, Lean UX increases a team’s ownership over the work by providing an opportunity for all opinions to be heard much earlier in the process.”

For example, forget the notion of a web designer hiding in an office for a week or so and then emerging with what he or she insists will be a “masterpiece” as the company’s new home page.

Particularly in software development, a key aspect of Lean and Agile development theories is the notion of creating a Minimum Viable Product (MVP). “Lean UX makes heavy use of the notion of MVP,” the two authors explain. “MVPs help test our assumptions–will this tactic achieve the desired outcome?–while minimizing the work we put into unproven ideas. The sooner we can find which features are worth investing in, the sooner we can focus our limited resources on the best solutions to our business problems. This concept is an important part of how Lean UX minimizes waste.”

The web designer’s “masterpiece” might work okay, but it also might offer costly confusions for customers and others visiting the website. Instead, Lean UX emphasizes collaboration, teamwork, testing prototypes, analyzing the results, gathering feedback from outsiders, revamping the project, testing it again–and continuing the process.

According to the writers, the most powerful tool in Lean UX is one that is basic to human beings: conversation. Indeed, conversation should be “the primary means of communication among team members.” Some of the other tools for collaboration also are basic: pencils, pens, notepads, whiteboards, blackboards, and simple paper templates that can spur discussions, opinions, and basic designs for the Minimum Viable Product and its successors, before moving the work to computers.

Lean UX is just 130 pages long. But it is rich with how-to examples, process descriptions, short case studies, clear steps, useful illustrations, and good examples that you can adapt and employ to create cheaper, faster, and better user experiences.


Si Dunn

Programming iOS 6, 3rd Edition – In with the New, Out with the Old (iOS 5 & Earlier) – #bookreview

Programming iOS 6, 3rd Edition
Matt Neuburg
(O’Reilly – paperback, Kindle)

“My book is way bigger than your book.”

Matt Neuburg, author of Programming iOS 6, could make that claim and win almost any book-size contest. The recently published 3rd Edition of his well-respected how-to guide focuses on the “Fundamentals of iPhone, iPad, and iPod touch Development” and now spans 1,154 pages in its paperback edition. It’s definitely much thicker and heavier than any of the devices it covers.

This new edition is centered on iOS 6.1 and xCode 4.6. The author notes that he has “eliminated most references to previous iOS versions.” And he explains: “Many iOS 6 features, of course, do not exist in iOS 5 or before; I usually mention that a new feature is new, but I have not generally addressed the problem of writing backwards-compatible code. The text would become confused and bloated if everything had to be qualified with advice for different versions (‘but if you’re targeting iOS 5.1, do this; if you’re targeting iOS 5.0, do that; if you’re targeting iOS 4.3, do the other’). I believe that I can justify such omissions on the grounds that previous editions of this book exist!”

Indeed they do. Programming iOS 5, which was published in two editions, also covers iOS 4.3 and is available on Amazon.com and through other sources..

“New iOS 6 features are, of course, both explained and adopted” in the new 3rd edition, Neuburg says. “For example, having described NSArray subscripting (in Chapter 10), I then use it consistently, in place of objectAtIndex:, throughout the rest of the book. Aside from this, the book’s structure remains the same as in previous editions, growing where necessary to accommodate explanations of new features, such as autolayout (in Chapter 14), state restoration (in Chapter 19), and collection views (in Chapter 21). Also, in response to reader requests, I have inserted a short example of Core Data programming into Chapter 36.”

Absolute beginners should not start with this book. Get some basic programming experience in C and Objective-C first.

And don’t be surprised that not everything about iOS is covered in a book 1,154 pages long. “It’s far too big to be encompassed in a book even of this size,” Neuburg emphasizes. “There are areas of Cocoa Touch that I have ruthlessly avoided discussing. Some of them would require an entire book of their own. Others you can pick up well enough, when the time comes, from the documentation. This book is only a beginning — the fundamentals.”

Si Dunn

Four good books that can help boost your JavaScript skills – #programming #bookreview

Ready for some enlightenment that can boost your JavaScript programming skills?

O’Reilly recently has published four books that can help you move from basic JavaScript library user to confident, experienced developer. 

“JavaScript started out as a simple and approachable front-end scripting language,” the publisher notes. “It has matured into a true cross-platform environment targeted by the latest emerging languages, frameworks, and developer tools.” The four new JavaScript books can help you “[l]earn how you can get the ultimate in responsiveness and interactivity from JavaScript, whether you use it on the front-end or server-side.” 

The four books are: JavaScript Enlightenment and DOM Enlightenment, both by Cody Lindley; Learning from jQuery by Callum Macrae; and Testable JavaScript by Mark Ethan Trostler.

#

JavaScript Enlightenment
Cody Lindley
(O’Reilly – paperback, Kindle)

Short, clear code samples are the stars of this fine, informative book. And most of the code samples can be viewed, executed and modified online using file links provided for the jsFiddle.net website.

The book’s goal is “to give the reader an accurate JavaScript worldview through an examination of native JavaScript objects and supporting nuances: complex values, primitive values, scope, inheritance, the head object, etc.” Cody Lindley adds: “I intend this book to be a short and digestible summary of the ECMAScript 3 Edition specification, focused on the nature of objects in JavaScript.”

Lindley keeps that promise in his 147-page book. His code samples rarely span more than a half page, and his explanatory paragraphs also are taut and to the point.

For example: “In JavaScript, objects are king: Almost everything is an object or acts like an object. Understand objects and you will understand JavaScript. So let’s examine the creating of objects in JavaScript….An object is just a container for a collection of named values (a.k.a properties).” 

Lindley’s book covers six of the nine native object constructors that are pre-packaged with JavaScript. The six are: Number(); String(); Boolean(); Object(); Array(); and Function(). He skips Date(), Error(), and RegEx() “because, as useful as they are, grasping the details of these objects will not make or break your general understanding of objects in JavaScript.” But he does hope you will learn them later, on your own. 

“JavaScript,” he writes, is mostly constructed from just these nine objects (as well as string, number, and boolean primitive values.) Understanding these objects in detail is key to taking advantage of JavaScript’s unique programming power and language flexibility.”

 # 

DOM Enlightenment
Cody Lindley
(O’Reilly – paperback, Kindle)

If you work with JavaScript, you probably rely on a Document Object Model (DOM) library such as jQuery to help you handle HTML scripting. 

But you can script the DOM without a DOM library, using JavaScript. Cody Lindley shows how in this excellent guide aimed at two types of developers who have experience with JavaScript, HTML, and CSS.

“The first developer is someone who has a good handle on JavaScript or jQuery, but has really never taken the time to understand the purpose and value of a library like jQuery,” Lindley writes. “The second type of developer is an engineer who is tasked with scripting HTML documents that will only run in modern browsers or that will get ported to native code for multiple OSes and device distributions (e.g., PhoneGap) and needs to avoid the overhead (i.e., size or size versus use) of a library.”

He notes that “HTML documents get parsed by a browser and converted into a tree structure of node objects representing a live document. The purpose of the DOM is to provide a programmatic interface for scripting (removing, adding, replacing, eventing, and modifying) this live document.”

Much of his 161-page DOM Enlightenment  focuses on how to work in JavaScript with “the most common types of nodes…one encounters when working with HTML documents.” He purposefully has “left out any details pertaining to XML or XHTML.” And, to help keep the book small, he has “purposely excluded the form and table APIs,” but adds: “I can see these sections being added in the future.”

Lindley also imposes a key technical limitation on the “content and code in this book….” It was, he says, “written with modern browsers (IE9+, Firefox latest, Chrome latest, Safari latest, Opera latest) in mind.”  

In keeping with the goals of O’Reilly’s Enlightenment series, explanations are short and concise and code examples are kept small. Also, the code examples are available online and can be displayed, run, and modified at the jsFiddle.net website.

 Cody Lindley emphasizes that he is “not promoting the idea of only going native when it comes to DOM scripting….” He hopes, instead,  “that developers may realize that DOM libraries are not always required when scripting the DOM.”

#

Learning from jQuery
Callum Macrae
(O’Reilly – paperback, Kindle)

Some developers work comfortably with jQuery yet have only a modest understanding of JavaScript.

Callum Macrae’s concise, well-written new book is intended to help fill that gap. It is “targeted at developers who know jQuery, but who don’t feel comfortable in their JavaScript knowledge or would just like to know more.”

The 102-page book focuses on the JavaScript code that jQuery covers up. It offers five chapters and two appendixes, with many short code examples and other illustrations. Much of the code is available through a GitHub repo.

Chapter 1, “Event Handling,” explains how event handling works in JavaScript and notes that “[e]vents are the heart of pretty much all web applications….jQuery provides a suite of functions to make event handling considerably easier than in JavaScript alone.” But these functions “add overhead and remove control from you, the developer. For this reason, it is important to know how you can handle events without jQuery in pure JavaScript.”

Chapter 2 covers “Constructors and Prototypes.” Writes Macrae: “Constructors are a way of creating objects, and can be initiated via the new keyword. Prototypes are one of the more powerful features of JavaScript, and allow the developer to declare a method or property that all instances of an object will inherit.” The chapter also can “help you understand how jQuery works, as jQuery itself uses prototypes.” 

Chapter 3 deals with “DOM Traversal and Manipulation.” Macrae notes that “jQuery includes a number of functions that make working with the DOM a lot easier than with JavaScript alone, which can be pretty ugly. However, the functions provided by jQuery can be rather hefty (especially in older browsers), and it is often a lot faster to just use pure JavaScript. Therefore, it is important to know how to work both.”

Chapter 4, “AJAX,” covers jQuery’s AJAX functions and concedes that they “offer some significant improvements over the native JavaScript AJAX features, as they are a lot easier to use.” Macrae explains: “AJAX is the act of making an HTTP request from JavaScript without having to reload the page; you could think of it as an inline HTTP request.” The chapter shows some jQuery AJAX requests and how those AJAX requests are sent in JavaScript. The goal is to help you get better at debugging code and also realize that “it isn’t worth loading the entire jQuery library to send a few requests and nothing else….”

Chapter 5, “JavaScript Conventions,” explains some “common conventions that you can use to improve your JavaScript…such as making your code more readable by using comments and whitespace correctly, optimizing your code in order to improve performance, design patterns, and some common antipatterns (code that causes more problems than it solves.)”

 This book is not recommended for persons who have no jQuery or JavaScript experience. Still, Appendix A, “JavaScript Basics,” provides a 28-page introduction to JavaScript, starting at “Hello World!” Appendix B, meanwhile, describes several applications and websites that can help you improve your JavaScript knowledge.

 # 

Testable JavaScript
Mark Ethan Trostler
(O’Reilly – paperback, Kindle)

“You have to test your code,” Mark Ethan Trostler emphasizes, “so why not make the process as easy and painless as possible?”

That’s a very desirable goal. Yet, as he notes a few sentences later, “testing–especially JavaScript testing–is complicated.”

For example: “Client-side JavaScript is especially difficult to test properly, as we have very little control over the environment within which our code runs. Multiple operating systems, multiple versions of operating systems, multiple browsers, multiple versions of browsers, not to mention plug-ins, extensions, different languages, zoom levels, and who knows what else, all conspire to hinder the performance of our applications. These permutations slow down, break, crash, and eat our applications for lunch. It’s a jungle out there!”

Trostler, a software engineer who works in test at Google, says his book “attempts to bridge the gap between sane development practices and JavaScript. JavaScript is a weird little language.” And he has aimed his guide at “people who encounter JavaScript professionally. Beginning, intermediate, or guru-level developers are all welcome, as this book has something for everyone.”

His 250-page how-to guide is structured into eight chapters that “tackle testable code in several steps. First we will investigate complexity. Then we will look at an architecture choice that attempts to limit complexity and coupling. With that as our foundation,” Trostler continues, “we will move on to testing, both at the functional level and at the application level.” From there, he delves into: code coverage; integration, performance, and load testing; debugging; and using automation in tests.

 “Writing unit tests for client-side JavaScript can be daunting,” Trostler states. “That means too many people don’t do it. This is not OK…”

Testable JavaScript is well written and rich with code examples, screenshots, diagrams and other illustrations. Whether you write client-side or server-side JavaScript — or both — or you are trying to rework some legacy files, Mark Ethan Trostler’s text can help you learn how to better create and maintain testable code.

Si Dunn