Write Portable Code: A Guide to Developing Software for Multiple Platforms

Mike Riley

October 30, 2009

3 Min Read
ITPro Today logo in a gray background | ITPro Today

PRObooks

 

Write Portable Code: A Guide to Developing Software forMultiple Platforms

Every so often a computer book comes along with aninteresting title that grabs the customer s attention enough to pick it up,thumb through it, and consider buying ... even when it s outside the normalboundaries of what that person might require immediately for their day job. Write Portable Code: A Guide to Developing Softwarefor Multiple Platforms is just such a book.

 

Author Brian Hook, a former game developer for id Softwareand graphics card maker 3dfx, has refined his years of programming experienceon numerous computing platforms, ranging from the Windows OS to the Sony PlayStation,and aggregated his expertise into this book. As such, the majority of the codein the book (freely available for download at http://www.writeportablecode.com)is written in ANSI C or C++. A major header file advocated by Hook and referredto throughout the book is his self-authored cross-platform abstraction headerfile called the Portable Open Source Header (POSH). A separate appendixdescribes the header file s intent and operation. Hook also uses his owncross-platform audio library, called the Simple Audio Library (SAL), in severalexamples to highlight the span of portability considerations that need to beaddressed when writing multi-platform code.

 

After introducing the basic tenants of portable code andthe cross-platform ways to manage source control, the book dedicates a chapterto each of the major aspects of a modern multimedia computing environment. Processors,compilers, UI, networking, operating systems, file systems, and dynamiclibraries are just some of the examples of the 18 chapters.

 

This is not a book about creating enterprise applicationswithin virtual machines, such as the CLR or JVM. It s a book about writingC-level code that can be easily compiled and executed on multiple platformswith little to no change in the original source. As such, don t expect adissertation on the joys of Java or the cool capabilities of C#. Rather, it sall about writing a high-performance application on a variety of hardware witha minimal amount of source code modification. Although this may not appeal tothose developers who have already bought into the belief that code written inthe 21st century must reside in and be protected by a virtual machine, the realworld demands high performance on a variety of platforms.

 

Viewed from that perspective, the author does an adequatejob of covering the landscape of considerations and concessions to be made, butthe book lacks a full-blown application or case study demonstrating all theprinciples examined in the book. It was also void of a comparative analysis onthe differences, advantages, and disadvantages of using the ANSI C approachversus Java or C# in high-performance situations. The only time the authorintroduces languages other than C/C++ is in his second to last chapter onscripting languages. Even with these omissions, the book is still aninteresting read that can help any developer think outside the box and considerthe time and architectural investment needed to write code beyond the bounds ofa single OS.

 

Mike Riley

 

Rating:

Title: Write Portable Code: A Guide to Developing Softwarefor Multiple Platforms

Author: BrianHook

Publisher: NoStarch Press

ISBN: 1-59327-056-9

Web Site: http://www.writeportablecode.com

Price: US$34.95

Page Count: 272

 

 

Sign up for the ITPro Today newsletter
Stay on top of the IT universe with commentary, news analysis, how-to's, and tips delivered to your inbox daily.

You May Also Like