Si Dunn

Archive for the ‘Object-oriented programming’ Category

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

In Book review, Book reviews, How-to, JavaScript, jQuery, Kindle, Object-oriented programming, Paperback, Programmer, Programming, Software, Software development, software testing on April 6, 2013 at 9:46 am

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

Intermediate Perl, 2nd Edition – An excellent guide to pushing well beyond the basics – #programming #bookreview

In Book review, Book reviews, How-to, Object-oriented programming, Paperback, Perl, Programmer, Programming, Software on August 29, 2012 at 1:04 pm

Intermediate Perl, 2nd Edition
Randal L. Schwartz, brian d foy & Tom Phoenix
(O’Reilly, paperback)

Attention, Perl programmers. Particularly those of you who write Perl programs with 100 lines of code or fewer but want to expand your limits. This popular intermediate guide, first published in 2006, has just been updated.

Intermediate Perl, 2nd Edition covers Perl 5.14. And: “It covers what you need to write programs that are 100 to 10,000 (or even longer) lines long,” the authors state.

This excellent book by three well-known Perl gurus does indeed cover a lot of ground. It shows you, for example, “how to work with multiple programmers on the same project by writing reusable Perl modules that you can wrap in distributions usable by the common Perl tools.”

It also shows you “how to deal with larger and more complex data structures….”

And it gets into some “object-oriented programming, which allows parts of your code (or hopefully code from others) to be reused with minor or major variations within the same program.”

It delves into two other important aspects of team programming: “…having a release cycle and a process for unit and integration testing. You’ll learn the basics of packaging your code as a distribution and providing unit tests for that distribution, both for development and for verifying that your code works in your target environment.”

One very important addition in the new edition is a chapter on references. “References,” the authors emphasize, “are the basis for complex data structures, object-oriented programming, and fancy subroutine handling. They’re the magic that was added between Perl versions 4 and 5 to make it all possible…” to handle “complex data interrelationships.”

The authors write in a lighthearted style that helps the coding medicine go down. And there are plenty of code examples and illustrations, plus a link to a website with downloads. They also provide exercises at the ends of chapters, with suggested completion times in minutes.

“If you take longer,” they add, “that’s just fine, at least until we figure out how to make ebooks with timers.”

However, if you take longer than “longer” or if you just get stumped, the answers conveniently are provided at the back of Intermediate Perl, 2nd Edition.

Si Dunn

Oh, Say Can You C#? – C# 5.0 in a Nutshell & C# 5.0 Pocket Reference -#programming #bookreview

In .NET, Book review, Book reviews, C#, How-to, Kindle, Microsoft, Object-oriented programming, Paperback, Programmer, Programming, Software, Windows on July 17, 2012 at 2:19 pm

O’Reilly recently has released two handy and helpful books for practitioners and students of the C# object-oriented programming language. One is a hefty, 1042-page “definitive reference” that (in paperback format) can double as a handy weight for physical exercise. The other is a compact, 215-page reference that really does fit in a coat pocket or pants pocket (but not a typical shirt pocket, unless you happen to wear an XXL, or larger, shirt).

Starting first with the muscle-building reference guide that weighs in at nearly three pounds…

C# 5.0 in a Nutshell, 5th Edition
Joseph Albahari and Ben Albahari
(O’Reilly, paperback, list price $49.99; Kindle edition, list price $39.99)

This latest Nutshell edition covers C# 5.0, “the fourth major update to Microsoft’s flagship programming language, an update that positions C# “as a language with unusual flexibility and breadth,” the authors state.

They note: “At one end, it [C#] offers high-level abstractions, such as query expressions and asynchronous continuations, while at the other end, it provides low-level power through constructions such as custom value types and the optional use of pointers.”

The revised and expanded new edition “covers C#, the CLR [Common Language Runtime], and the core Framework assemblies. The authors have chosen this focus “to allow space for difficult topics such as concurrency, security and application domains—without compromising depth or readability.” It’s hard to argue with the “depth” of a book 1,000+ pages long. And the book is written clearly, with numerous short code examples to illustrate its points.

C# 5.0 in a Nutshell is aimed at readers with intermediate to expert knowledge of programming, but no prior knowledge of C# is assumed. Indeed, chapters two through four provide an introduction to C# basics, starting just above the “Hello, World” level with a program that multiplies 12 times 30. The remaining chapters cover advanced C# 5.0 topics and the core .NET framework. With just a few exceptions, you can read these chapters randomly.

The hefty book has a hefty index. It has been “shaped by more than 20 expert reviewers,” including several from Microsoft. And the authors have solid backgrounds in their subject matter.

And now, for something a bit lighter…

C# 5.0 Pocket Reference
Joseph Albahari and Ben Albahari
(O’Reilly, paperback, list price $19.99; Kindle edition, list price $11.99)

The Nutshell authors have boiled their big book down to a very practical aid that you can easily carry to work, class or your favorite coffee shop or when traveling. Conveniently, the Pocket Reference still includes an introduction to C# 5.0’s fundamentals, starting with the simple multiplication program. It also covers many advanced topics, ranging from operator overload and Language Integrated Query (LINQ) to preprocessor directives, custom attributes, and XML documentation.

This book is not organized by chapters, so you will find yourself making frequent use of the book’s two-page table of contents and 12-page index, particularly if you are new to C# 5.0.

But you can readily find brief explanations, code samples and illustrations that define and clarify much of what you are seeking. And you will appreciate the book’s convenient size.

Si Dunn

Programming Clojure, 2nd Edition – The virtues of concurrency and functional style – #bookreview #in #programming

In Book review, Book reviews, Clojure, Functional programming, How-to, Java, Object-oriented programming, Paperback, Programmer, Programming, Software on June 19, 2012 at 9:19 am

Programming Clojure, 2nd Edition
Stuart Halloway and Aaron Bedra
(Pragmatic Bookshelf,
paperback, list price $35.00)

Clojure is yet another computer programming language with an odd name and many followers.

For example, Dr. Venkat Subramaniam, an award-winning author and founder of Agile Developer, Inc., has called Clojure “a beautiful, elegant, and very powerful language on the JVM [Java Virtual Machine].”

A lot has happened to Clojure (pronounced like “closure”) since the first edition of this book was published in 2009. Clojure has been updated several times and gained some enhancements, a lot of new followers, and many libraries.

Programming Clojure, 2nd Edition has been rewritten and reorganized to cover these new features, concepts and developments.

“Clojure is a powerful, general-purpose programming language,” the authors note. But this is not a book for raw beginners, even though its first chapter does start at the traditional “Hello, world” level. It is intended for “experienced programmers looking for power and elegance.” You should have some experience with C#, Java, Python, or Ruby before tackling Clojure.

“Clojure is built on top of the Java Virtual Machine, and it is fast,” Halloway and Bedra emphasize. “This book will be of interest of Java programmers who want the expressiveness of a dynamic language without compromising on performance.”

They add: “If you program in Lisp, use a functional language such as Haskell, or write explicitly concurrent programs, you will enjoy Clojure.”

Indeed, Clojure’s creator, Rick Hickey, emphasizes the language’s value as an alternative to the “complexity” introduced in object-oriented programming. “Object-oriented programming seems easy,” he states, “but the programs it yields can often be complex webs of interconnected mutable objects.”

He continues: “Functional programming offers an alternative. By emphasizing pure functions that take and return immutable values, it makes side effects the exception rather than the norm. Clojure is designed to make functional programming approachable and practical for commercial software developers.”

Clojure also makes concurrent programming easier. “Many languages build a concurrency model around locking, which is difficult to use correctly,” the authors point out. “Clojure provides several alternatives to locking: software transactional memory, agents, atoms, and dynamic variables.”

The 268-page book is well-organized and well written, and it offers numerous practical code examples. The book also has been reviewed for technical accuracy by a panel of Clojure practitioners.

Clojure code, incidentally, tends to be short (but you do need an editor that can “at least indent code correctly and can match parentheses”).

In one of the book’s comparison examples, the function produced by a 14-line sample of Java code is duplicated in Clojure with just two lines. So development in Clojure potentially can be fast.

Si Dunn

Learning iOS Programming, 2nd Ed. – Updated to cover iOS 5, iPad, iPhone, iPod Touch – #programming #bookreview

In Apple, Book review, Book reviews, C programming, C#, Cloud Computing, How-to, iOS, iPad, iPhone, iPod, Kindle, Mac OS X, Macintosh, Object-oriented programming, Objective-C programming, Paperback, Programmer, Programming on May 14, 2012 at 1:00 pm

Learning iOS Programming, 2nd Edition
By Alasdair Allan
(O’Reilly, paperback, list price $34.99; Kindle edition, list price $27.99)

Alasdair Allan’s popular iOS programming book recently has been updated to cover iOS 5. And it has a new name. (The first edition was titled Learning iPhone Programming.)

“The changes made in this second edition reflect the fact that a lot has happened since the first edition was published: the release of the iPad, a major release of Xcode, two revisions of the operating system itself, and the arrival of Apple’s iCloud,” the author notes. “This book has therefore been refreshed, renewed, and updated to reflect these fairly fundamental changes to the platform, and all of the example code was rewritten from the ground up for Xcode 4 and iOS 5 using ARC.”

Allan’s book – well-written and appropriately illustrated – is structured to provide “a rapid introduction to programming for the iPhone, iPod touch, and iPad,” and it assumes that you have some familiarity with C or a C-derived language, as well as a basic understanding of object-oriented programming.

And the pace is fast. By chapter 3, you are building the requisite “Hello, World” application and running it in iPhone Simulator.

In that same chapter, Allan also introduces the basic syntax of Objective-C and highlights some of the “rather strange” ways that it deals with method calls. He discusses how the Cocoa Touch framework underlying iOS applications “is based on one of the oldest design patterns, the Model-View-Controller pattern, which dates from the 1970s.” And he warns that “[a]ttempting to write iOS applications while ignoring the underlying MVC patterns is a pointless exercise in make-work.”

Learning iOS Programming, 2nd Edition does not emphasize web-based applications. It centers, instead, on creating native applications using Apple’s SDK. “The obvious reason to use the native SDK,” Allan states, “is to do things that you can’t do using web technologies. The first generation of augmented reality applications is a case in point; these needed close integration with the iPhone’s onboard sensors (e.g., GPS, accelerometer, digital compass, and camera) and wouldn’t have been possible without that access.”

He emphasizes a financial reason, as well. “Consumers won’t buy your application on their platform just because you support other platforms; instead they want an application that looks like the rest of the applications on their platform, that follows the same interface paradigms as the rest of the applications they’re used to, and is integrated into their platform.”

He adds: “If you integrate your application into the iOS ecosphere, make use of the possibilities that the hardware offers, and make sure your user interface is optimized for the device, the user experience is going to be much improved.”

Hard to argue with that.

Learning iOS Programming, 2nd Edition provides the steps necessary to develop and market your first iOS application. Allan notes: “Until recently, the only way to obtain the iOS SDK was to become a registered iOS developer. However, you can now download the current release of Xcode and the iOS SDK directly from the Mac App Store.”

Of course, if you intend to distribute your applications “or even just deploy them onto your own device, you will also need to register with Apple as a developer and then enroll in one of the developer programs.”

You may need some system upgrades, as well. To develop apps for the iOS, you’ll need an Intel Mac running OS X 10.6 (“Snow Leopard”) or later. If you plan to create apps that use Apple’s iCloud, you’ll need OS X 10.7 (“Lion”) or later.

One other recommendation from Allan: If you’re truly serious about being an iOS developer, consider also registering with the Mac Developer Program.

#

Si Dunn is a novelist, screenwriter, freelance book reviewer, and former software technical writer and software/hardware QA test specialist. He also is a former newspaper and magazine photojournalist. His latest book is Dark Signals, a Vietnam War memoir. He is the author of an e-book detective novel, Erwin’s Law, now also available in paperback, plus a novella, Jump, and several other books and short stories.

Think Complexity – Exploring Complexity Science with Python – #programming #bookreview

In Book reviews, Complexity science, Kindle, Object-oriented programming, Paperback, Programmer, Programming, Python, Software, Technology on March 27, 2012 at 4:19 pm

Think Complexity
By Allen B. Downey
(O’Reilly, paperback, list price $29.99)

Are you a reasonably competent Python programmer yearning for new mental challenges? Allen B. Downey’s Think Complexity definitely can deliver some. His well-written new book can help you dive into complexity science and improve your Python skills at the same time.

Right away, you will see that Think Complexity is not just another how-to-program-in-Python book.

“This book,” Downey states, “is about data structures and algorithms, intermediate programming in Python, computational modeling, and the philosophy of science.” Hello, new world.

His new work, he adds, sprang out of a blending of “boredom and fascination: boredom with the usual presentation of data structures and algorithms and fascination with complex systems. The problem with data structures is that they are often taught without a motivating context; the problem with complexity science is that it usually is not taught at all.”

Complexity science is the scientific study of complex systems – which can be anything from computer networks to the human brain, global markets, ecosystems, metropolitan areas, space shuttles, ant trails, and countless other “systems.”

Complexity science is practiced “at the intersection of mathematics, computer science, and natural science,” Downey says.

How does “the philosophy of science” fit in? Downey’s book offers “experiments and results [that] raise questions relevant to the philosophy of science, including the nature of scientific laws, theory choice, realism and instrumentalism, holism and reductionism, and epistemology.”

Think Complexity “picks up where Think Python left off” and is intended to appeal to the “broad intellectual curiosity” of software engineers and their “drive to expand their knowledge and skills.”

There are case studies, exercises, code samples and even mini-lessons within the exercises. One brief example: “Hoisting is a way to speed up code by moving an expression that does not change out of a loop.” (Hoisting then is applied in a discussion involving Fast Fourier Transform and the Danielson-Lanczos Lemma.)

Not every exercise has an answer against which you can check your work. So you probably shouldn’t jump into this book just now unless you feel confident you are an intermediate-level Python programmer and you are open to wide-ranging mental challenges.

Python, by the way, is a free download available in 2.X and 3.X versions. And, along with Think Python, several other books can help you advance from novice to Python professional.

Head First Python by Paul Barry is a fun, “brain-friendly guide” nicely tailored for beginners who want to advance from “What’s Python?” to understanding how to use the language in real-world applications. The book is written for 3.X versions. And it uses multiple learning methods (often in amusing ways) to help impart the necessary how-to information.

Once you gain a basic understanding of Python, Mark Lutz’s book Learning Python is recommended as the next step. His 4th edition covers both the 2.6 and 3.X versions. If you are a complete Python beginner, you might want to put this book second on your list, rather than dive into it from a cold start. It has 39 chapters and 1162 pages, and it weighs nearly four pounds – which can make it seem a very intimidating starting point. Still, it is a well-written, self-paced tutorial, and it can help you advance to intermediate-level Python programmer and beyond.

Students at Olin College (where Allen B. Downey is a computer science professor) wrote the case studies for Think Complexity. (They were edited by Downey and his wife and reviewed by other Olin faculty members). Appendix A of Downey’s new book contains a call for readers to submit additional case studies.

“Reports that meet the criteria [explained in the appendix] will be published in an online supplement to this book, and the best of them will be included in future print editions.”

This may be an offer – and a Python challenge — you can’t refuse.

#

Si Dunn is a novelist, screenwriter, freelance book reviewer, and former software technical writer and software/hardware QA test specialist. He also is a former newspaper and magazine photojournalist. His latest book is Dark Signals, a Vietnam War memoir available now in paperback. He is the author of a detective novel, Erwin’s Law, a novella, Jump, and several other books and short stories.

Making Embedded Systems (for things that blink & go ‘Beep!’ in the night) – #programming #bookreview

In Authors, Book reviews, Books, Embedded systems, Hardware, Kindle, Nonfiction, Object-oriented programming, Paperback, PC, Programmer, Programming, Software, Technology, Uncategorized on December 6, 2011 at 1:46 pm

Making Embedded Systems
By Elecia White
(O’Reilly, paperback, list price $39.99; Kindle edition, list price $31.99)

Elecia White loves embedded systems. “The first time a motor turned on because I told it to, I was hooked,” she writes in her new book, Making Embedded Systems. “I quickly moved away from pure software and into a field where I can touch the world.”

In that world, she has “worked on DNA scanners, inertial measurement units for airplanes and race cars, toys for preschoolers, a gunshot location system for catching criminals, and assorted medical and consumer devices.”

It is a world where “embedded systems don’t have operating systems. The software runs on the bare metal. When the software says ‘turn that light on,’ it says it to the processor without an intermediary.”

So this is not a book about embedded operating systems. Just embedded systems. And the intended audience is intermediate and experienced programmers seeking new challenges.

The author’s basic definition of an embedded system is “a computerized system that is purpose-built for its application.”

She says she wrote her book (and it is well-written, by the way) “almost as a story, to be read from cover to cover. The information is technical (extremely so in spots), but the presentation is casual.”

So she hopes readers will not treat Making Embedded Systems as “a technical manual where you can skip into the middle and read only what you want.” With that approach, “you’ll miss a lot of information…[and] You’ll also miss the jokes, which is what I really would feel bad about.”

Embedded system compilers typically support only C or C++ (and often just a subset of that language), she notes. And: “There is a growing popularity for Java, but the memory management inherent to the language works only on a large system.”

Meanwhile, debugging an embedded system often can be challenging, because it’s not always easy to tell if a problem lies in the software or in the associated hardware.

Elecia White’s 310-page book is divided into 10 chapters, with illustrations, code examples and a good index:

  1. Introduction(Discusses embedded systems and how their development differs from traditional software development.)
  2. Creating a System Architecture(How to create – and document – a system architecture.)
  3. Getting Your Hands on the Hardware(Dealing with hardware/software integration and board bring-up.)
  4. Outputs, Inputs, and Timers(The simple act of making an LED blink is more complicated than you might think.)
  5. Managing the Flow of Activity(How to set up your machine, how to use [or not use] interrupts, and how to make a state machine.)
  6. Communicating with Peripherals(“Different serial communications forms rule embedded systems.…” But: “Networking, bit-bang, and parallel buses are not to be discounted.”)
  7. Updating Code(Options for replacing the program running in a processor.)
  8. Doing More with Less(How to reduce RAM consumption, code space, and processor cycles.)
  9. Math(“Most embedded systems need to do some form of analysis.” Make your system faster by “[u]nderstanding how mathematical operations and floating points work [and don’t work]….”)
  10. Reducing Power Consumption(Your system may run on batteries. Better system architecture and reducing processor cycles can help cut power drain.)

Making Embedded Systems also includes helpful information on how to read a schematic diagram, why it’s best to run tests on three of the same prototype devices, not just one, and what interviewers look for when meeting with applicants for embedded systems jobs.

An embedded system, the author says, often is viewed as a jigsaw puzzle that only fits together one way. But she challenges readers to see the puzzle as also having “a time dimension that varies over its whole life: conception, prototyping, board bring-up, debugging, testing, release, maintenance, and repeat.”

Embedded system design presents many challenges, she says, and demands constant flexibility.

“Our goal is to be flexible enough to meet the product goals while dealing with the resource constraints and other challenges inherent to embedded systems.”

Si Dunn

Getting .NET Results – 2 New Books from Microsoft – #programming #bookreview

In .NET, Book reviews, Books, Kindle, Microsoft, Object-oriented programming, PC, Programmer, Programming, Software, Technology on November 29, 2011 at 1:09 pm

Microsoft Press recently has released two new books for .NET programmers. One is for .NET newcomers, and the other definitely is not. That book has been written “to help existing Microsoft Visual Basic and Microsoft Visual C# developers understand collections in .NET.”

Here are short reviews of each book.

Easy Does It

Start Here! Fundamentals of Microsoft .NET Programming
By Rod Stephens
(Microsoft Press, paperback, list price $19.99; Kindle edition, list price $15.99)

This is a very good reference manual for anyone ready to take up .NET programming or ready to learn virtually any programming language.

Don’t be put off by the fact that the book starts out at the most basic of basic levels, defining different types of computers, just in case you don’t know a laptop from a mainframe. After that, it moves quickly into the world of programming.

You don’t need a computer, software, programming language tools or programming experience to learn from this book. Indeed, it mostly employs pseudo-code, illustrations and clear writing to explain each topic.

The idea here is to teach you “the basic concepts that drive all .NET-based languages” and to provide a reference book that you can refer back to when you are unsure about a particular term, concept, process or method.

For example, if you are now learning Microsoft Visual C# or Visual Basic, you might need to review the chapter on operators, to be sure you clearly understand what may happen if the wrong symbol is used and the correct order of precedence is not followed.

The 14 chapters of Fundamentals of Microsoft .NET Programming deal with subjects many programmers definitely should know:

  • Chapter 1, “Computer Hardware”
  • Chapter 2, “Multiprocessing”
  • Chapter 3, “Programming Environments”
  • Chapter 4, “Windows Program Components” – (Describes the visible pieces of a Windows program that a user sees and how to use them effectively as a programmer.)
  • Chapter 5, “Controls” – (Such as labels, text boxes, menus, sliders, scroll bars, etc.)
  • Chapter 6, “Variables”
  • Chapter 7, “Control Statements’” – (Using them to manage a program’s flow of execution.)
  • Chapter 8, “Operators”
  • Chapter 9, “Routines”
  • Chapter 10, “Object-Oriented Programming”
  • Chapter 11, “Development Techniques”
  • Chapter 12, “Globalization” – (Explains how to localize a program in Visual Studio so that it works in multiple places. Also looks at several localization issues.)
  • Chapter 13, “Data Storage”
  • Chapter 14, “.NET Libraries” – (Describes some of the most-useful libraries for writing .NET programs.)

You can read the 14 chapters in any order, jumping around “to suit your interests and needs,” the author adds.

That’s the hallmark of a good reference book.

#

Taking Up Collections

Developer’s Guide to Collections in Microsoft .NET
By Calvin Janes
(Microsoft Press, paperback, list price $34.99; Kindle edition, list price $23.99)

“This book,” the author cautions, “is not a .NET primer for beginners; it’s intended for developers already conversant with .NET and comfortable with either the C# or Visual Basic .NET language.”

Developer’s Guide to Collections in Microsoft .NET is heavy on how-to code examples and exercises, and all sample projects can be downloaded from a web page specified in the text. Many of the code examples conveniently are shown both in C# and Visual Basic.

The book is divided into 11 chapters that are grouped into four parts:

  • Part 1, Collection Basics
  • Part II, .NET Built-in Collections
  • Part III, Using Collections
  • Part IV, Using Collections with UI Controls

There is also a nicely detailed, 14-page index.

“The book is arranged so that developers who are new to collections can get started quickly, and those who are already familiar with collections can treat the book as a useful reference,” the author says.

He has included a helpful table titled “Finding Your Best Starting Point in This Book.” For example, if you are not new to .NET and want to learn how to query your collections with the Language Integrated Query (LINQ), the table advises: “Read through Chapter 7 in Part III.” That’s the “Introduction to LINQ” chapter.

The author says he wanted to create “a one-stop shop for anyone struggling with collections: from beginners to experts who just need a reference or a few pointers here and there.”

With this fine work, he has met that goal. Its 624 pages are packed with good how-to collections information, clearly explained and illustrated, from how to implement arrays and synchronize data across threads to how to use simple data binding to display collections in Windows Forms®, Windows Silverlight® and Windows Presentation Foundation®.

Si Dunn

A gift for the programmer who has everything? The Art of Readable Code – #programming #bookreview

In Authors, Book reviews, Java, JavaScript, Kindle, Microsoft, Nonfiction, Object-oriented programming, Paperback, PC, Programmer, Programming, Software, Uncategorized, Windows on November 28, 2011 at 3:15 pm

The Art of Readable Code: Simple and Practical Techniques for Writing Better Code
By Dustin Boswell and Trevor Foucher
(O’Reilly, paperback, list price $34.99; Kindle edition, list price, $27.99)

The software world is full of bad code.

Code that was badly written; code that has been reworked — badly — by dozens of undisciplined programmers; code written in haste to patch or hide a problem; code written without comments that can help you decipher what the previous programmer was thinking — or not thinking; code written by people like me, who didn’t know much at all about programming but had to produce some emergency code anyway, because the real programmers were away on vacation.

The Art of Readable Code could be a very useful book to give the programmer in your life — whether he or she is new to computer programming or an open-minded mid-career professional looking to make some improvements in how they work.

The book focuses on “basic principles and practical techniques” that programmers can apply each time they begin a new coding project or find themselves patching an old one.

The authors present what they call their “Fundamental Theorem of Readability.” In their view: “Code should be written to minimize the time it would take for someone else to understand it.”

For example, “smaller” may not always be better. A one-line expression may be more understandable to other programmers if it is broken into two lines of code.

The 190-page book illustrates its concepts with examples of code from several different programming languages, including C++, Python, JavaScript, and Java. The authors add: “We’ve avoided any advanced language features, so even if you don’t know all these languages, it should still be easy to follow along. (In our experience, the concepts of readability are mostly language-independent, anyhow.)”

The Art of Readable Code has 15 chapters and an appendix and is structured in four parts:

  • Part 1: Surface Level  Improvements – (Naming, commenting and aesthetics that can be applied to every line of code)
  • Part 2: Simplifying Loops and Logic – (Refining loops, logic, and variables so they are easier to understand)
  • Part 3: Reorganizing Your Code – (Higher-level ways to organize large blocks of code and go after problems at the function level)
  • Part 4: Selected Topics – (Applying “easy to understand” to software testing and to a larger data structure coding example)

The authors state: “It’s a valuable skill to be able to explain an idea ‘in plain English….The same skill should be used when ‘presenting’ code to your reader. We take the view that source code is the primary way to explain what a program is doing. So the code should be written ‘in plain English.’”

The book itself is smoothly written and nicely illustrated, not only with cartoons but with some very clear code examples that can be quickly applied.

Si Dunn

Mac Attack! Three new books for Macintosh users – #bookreview

In Apple, Book reviews, Cloud Computing, Kindle, Macintosh, MacOS, MacRuby, Nonfiction, Object-oriented programming, Paperback, PC, Programmer, Programming, Ruby, Software, Technology, Uncategorized, United States, Windows on November 25, 2011 at 7:46 pm

No Starch Press and O’Reilly Media recently have released three new books aimed at Macintosh users.

One is for Mac newcomers. Another is for those who want to learn a lot more about the Mac OS X Lion operating system without having to read “tersely written” Apple help screens. And the third is for programmers who want “to build native Mac OS X applications with a sleek, developer-friendly  alternative to Objective-C….”

Taking it easy first…

Doing ‘Simple Projects’ with a Mac

My New Mac Lion Edition: Simple Projects to Get You Started
By Wallace Wang
(No Starch Press, paperback, list price $29.95 ; Kindle edition, list price $9.99)

If you are computer newbie or switching over from Windows or other operating systems, here is a good book to help you put your new Mac to work in a hurry.

My New Mac Lion Edition shows how to do practical stuff such as connecting to the Web, playing and burning CDs and DVDs, pulling digital photos off your camera so you can edit and share them, and working with the Mac’s security features.

Given today’s risky Internet and office computing environment, it might have been better to describe the security features much earlier in the book, well before the working-online chapters. But as a practical guide to learning and using the Mac’s key features, this 472-page how-to guide is written well and has plenty of illustrations and clear lists of steps. It even describes several ways to eject a stuck CD or DVD.

The 56 chapters are grouped into seven parts:

  • Part 1: Basic Training – Everything from using the mouse to opening apps.
  • Part 2: Wrangling Files and Folders – Finding files, storing files, sharing files.
  • Part 3: Making Life Easier – Shortcut commands, controls, updating software, saving and retrieving contact information, using appointment calendar, and typing in foreign languages.
  • Part 4: Playing Music and Movies - Playing audio CDs, ripping and burning audio CDs, playing a DVD, listening to online programs and free college lectures, and editing videos with iMovie.
  • Part 5: The Digital Shutterbug – Transferring, editing and displaying digital photographs.
  • Part 6: Surfing and Sharing on the Internet – Numerous things web and email, plus instant messaging with iChat.
  • Part 7: Maintaining Your Mac – Energy conservation, ejecting stuck CDs/DVDs, password protecting  your Mac, encrypting your data, and configuring your firewall.

The author, Wallace Wang, has written several best-selling computer books. He’s also an ongoing career as a standup comic.

More IS Better: What to Do with 50+ Programs and 250 New Features

Mac OS X Lion: The Missing Manual
By David Pogue
(O’Reilly, paperback, list price $34.99)

David Pogue created the popular Missing Manual series, and the New York Times technology columnist definitely knows how to put together a good how-to book.

His 909-page Mac OS X Lion: The Missing Manual is exactly what you need to become (over time and with diligent effort, of course) a Mac power user. It’s also what you need if you’d rather settle for being a well-informed user who likes having a handy source  for looking up information about a Mac feature or program.

In this book, you begin well beneath the “Hello, World!” level by learning to say “oh-ess-ten,” not “oh-ess-ex.” Once you master that, you get to move into ”The New Lion Landscape,” where you are informed that “Apple’s overarching design philosophy in creating Mac OS X was: ‘Make it more like an iPad.’”

Then, you quickly learn how to use “Full Screen Mode, Safari” and “Full Screen Apps, Mission Control.” And, by the way, you are still officially in Chapter 0 at this point (that’s “zero,” not “oh”).

Pogue’s book is smoothly written. (You don’t, after all, just luck into writing for the Times.) It has a good array of screenshots and other illustrations. And it offers plenty of tips and notes amid the instructional paragraphs.

The book’s six parts (with seven chapters each) are focused as follows:

  • Part 1: The Mac OS X Desktop – “[C]overs everything you see on the screen when you turn on a Mac OS X computer….”
  • Part 2: Programs in Mac OS X - Describes “how to launch them, switch among them, swap data between them, use them to create and open files, and control them using the AppleScript and Automator automation tools.”
  • Part 3: The Components of Mac OS X - “[A]n item-by-item discussion of the individual software nuggets that make up this operating system–the 29 panels of System Preferences and the 50-some programs in your Applications and Utilities folders.”
  • Part 4: The Technologies of Mac OS X – “Networking, file sharing, and screen sharing…” plus “fonts, printing, graphics, handwriting recognition…sound, speech, movies…” and even some looks at how to use “Mac OS X’s Unix underpinnings.”
  • Part 5: Mac OS X Online – “[C]overs all of the Internet features of Mac OS X.” Everything from email to chatting to working in the cloud, and even “connecting to, and controlling, your Mac from across the wires — FTP, SSH, VPN, and so on.”
  • Part 6: Appendixes – These include a Windows-to-Mac dictionary (for Windows refugees), information on installing Mac OS X, troubleshooting information, and “a thorough master list of all the keyboard shortcuts and trackpad/mouse gestures in Lion.”

If you’re serious about using your Mac and weary of opening endless not-so-helpful help screens, you should seriously consider owning this book.

A Programmer’s Guide to MacRuby

MacRuby: The Definitive Guide
By Matt Aimonetti
(O’Reilly, paperback, list price $39.99; Kindle edition, list price $31.99)

“MacRuby,” the author says, “is Apple’s implementation of the Ruby programming language on top of the Objective-C technology stack.”

His book is a straightforward, no-nonsense guide intended to show developers how “to write native applications for the Cocoa environment using the popular Ruby syntax as well as the well-known and robust Objective-C and C libraries.”

He declares his work “neither a Ruby book nor a Cocoa book,” but states that “it should provide you with enough information to understand the MacRuby environment and create rich applications for the OS X platform.”

MacRuby: The Definitive Guide is segmented into two major parts. Part 1 (“MacRuby Overview”) introduces MacRuby, including what it is, how it’s installed, how it works, what you can do with it, and how it relates to what you already probably know. Part 2 (titled “MacRuby in Practice”)  ”covers concrete examples of applications you might want to develop in MacRuby.”

Using short, concise code examples, Matt Aimonetti helps the reader dive straight into MacRuby, beginning at the classic ”Hello, World!” entry point, with a little twist.

In just 35 lines of code, you learn how to build a graphical user interface (GUI) application that displays the words ”MacRuby: The Definitive Guide” in a window with a button. The window shows “Hello World!” within a box, and your computer speaks “Hello, world!” when you click on the button.

The first eight chapters focus on topics such as: introduction, fundamentals, foundation, application kit, Xcode, core data, and getting deeper into the process of “developing complex apps.”

The topics of the final five chapters are: (1) creating an Address Book example; (2) creating an application that ”uses the user’s geographical location and a location web service”; (3) using MacRuby in Objective-C projects; (4) using Objective-C code in MacRuby apps; and (5) using Ruby third-party libraries. 

Before reading this book and tackling the code, the author recommends having some programming experience and basic familiarity with object-oriented programming. You also should get a basic overview of the Ruby language by visiting its main website.

Si Dunn 

Follow

Get every new post delivered to your Inbox.

Join 1,349 other followers