12 of 12 people found the following review helpful:
4.0 out of 5 stars
Excellent Book, Misleading Title, 19 Feb 2006
By David Chazin - Published on Amazon.com
This review is from: Write Portable Code: A Guide to Developing Software for Multiple Platforms (Paperback)
This book is an excellent read. The material is presented completely, concisely, and in an easy to understand manner. However the title of this book is misleading. It really should be "Write Portable code in C". There is some limited discussion of C++, but mostly to discourage you from using it. All other languages are dismissed out of hand, or just completely ignored. As long as you understand this caveat there is much to learn from this book.
This book is really focused on writing software that will run on essentially any platform that has a C compiler, which today is almost all processors. If you need to write software that will run on embedded 16 bit processors as well as the latest 64 bit ones, then you should read this book. However, there are large classes of software that have a more limited notion of portability (such as running on most 32 bit Unix or Windows platforms, or any platform that g++ can target) where Standard C++ or Java are the way to go. Unfortunately the book does not adequately address the tradeoffs, design, and implementation decisions one should make in these cases. In particular, I am puzzled by the total lack of Java solutions.
Since the book emphasizes C programming, there is minimal content on GUI programming, Web programming, database programming, and similar areas where C programming is rarely used anymore.
8 of 9 people found the following review helpful:
4.0 out of 5 stars
I need this book, 24 Sep 2005
By Ivan Milles - Published on Amazon.com
This review is from: Write Portable Code: A Guide to Developing Software for Multiple Platforms (Paperback)
Enter Brian Hook's Write Portable Code. Portability is a sort of a holy grail for programmers, and there is no lack of knowledge floating around Usenet and Internet. However, Brian Hook tried to recommend a book on the subject to a friend, and didn't find one. So he set out to write his own.
The result is a tome that should reside on every programmers desk sooner or later. The book's cover pictures a donkey striving uphill, and I can definitely releate to that. Portability is not only a target hard to aquire, but it is also a target roaming about in a minefield. I consider myself a best-practice programmer: stability and portability is important to me. However, while reading this book, I quickly realized that I know nothing. Each and every chapter contained possible gotchas that have eluded me for years. This book does two things: it points out those gotchas, and it gives the reader oodles of clever tricks, background info and solutions. And best of all, those tricks are often of the stablest possible quality.
Diving into this book, I had to break up old ideas about what is safe and not. For can you rely on sizeof(int)? Are you sure main() is your entry point? What if you need to move to a mixed-endian platform? Westwood's assumptions about floating point behaviour made it impossible for Aspyr to implement network play across platforms for Command & Conquer: Generals. Deciding on portability is also a matter of choosing your platforms. Hook points out that you can write a program that runs the same on a clustered super computer as well as a coffee machine, but it doesn't make much sense. Instead, establishing a baseline will go a long way towards keeping your sanity. He does not, however, back down from tricky configurations: there are recommendations and warnings that apply to esoteric platforms, e.g. embedded environments with very limited resources.
Many of the examples in the book are drawn from a cross-platform audio library (SAL) that Brian Hook has written. Seeing the concepts in the book in their actual implementation brings a lot to the table - his treatise points out both goals, possible problems, and solutions.
Since the book is so C++-centric, I would have valued information on the Standard Template Library (STL). While its name promises a standard, it has a few extensions that might not always be around. Performance characteristics also vary across implementations.
Brian Hook has a remarkably clear and readable language. Even though the material in the book is complex, and Hook is writing in a very to-the-point manner, every nuance of the issue gets across. A result of many hours of editing, I'm sure, and those were hours well spent. I finally managed to get the ISO, ANSI, IEEE and many of their different standards sorted out in my head, no small feat for Brian!
Achieving portability is a matter of being extremely cautious, and it is surrounded by many misconceptions and myths. In that regard, Provided that Brian is right (which I'm really not qualified to tell), he becomes a sort of myth-buster. However, since he comes from a background with portability engineering at id Software and 3Dfx, he does have the history to back up his tricks.
The book is very C/C++-centric, but many of the concepts are directly portable to other languages such as (yes) Java. As for the code samples, they are a bit long-winded at times, but always clear. My only gripe is that some of the Mac source code samples aren't always optimal - they are correct and work, but could sometimes have been accomplished in a less complex way. That is, however, mostly a question of form.
5 of 5 people found the following review helpful:
4.0 out of 5 stars
Good Book for C/C++, Interesting For Others, 25 Aug 2005
By James Holmes "Co-Author 'Windows Developer Po... - Published on Amazon.com
This review is from: Write Portable Code: A Guide to Developing Software for Multiple Platforms (Paperback)
This book is an in-depth discussion of issues involved in getting C/C++ code from one platform to another. Hook dives deep into arcane topics such as processor memory access alignment, floating point operation platform differences, and exception handling. The book's not for the faint-of-heart, and it's rather specific to C/C++; however, readers brave enough to push through the book should get interesting insights regardless of what platform and development environment they're working with.
This appears to be a great resource for folks who are actively porting software. It's a very good guidebook of issues to address if you're even thinking about porting. I'd also say it's a good skimming read for most developers if only to get an understanding of some engineering principles to consider when building your systems. You never know when your platform might fold or get deprecated.