Buy used:
$14.97
$10.53 delivery October 23 - November 15. Details
Used: Very Good | Details
Condition: Used: Very Good
Comment: May have limited writing in cover pages. Pages are unmarked. ~ ThriftBooks: Read More, Spend Less
Access codes and supplements are not guaranteed with used items.
Added to

Sorry, there was a problem.

There was an error retrieving your Wish Lists. Please try again.

Sorry, there was a problem.

List unavailable.
Other sellers on Amazon
Kindle app logo image

Download the free Kindle app and start reading Kindle books instantly on your smartphone, tablet, or computer - no Kindle device required.

Read instantly on your browser with Kindle for Web.

Using your mobile phone camera - scan the code below and download the Kindle app.

QR code to download the Kindle App

Follow the author

Something went wrong. Please try your request again later.

Write Portable Code: An Introduction to Developing Software for Multiple Platforms 1st Edition

3.9 3.9 out of 5 stars 13 ratings

Portable software development is writing software that runs on a broad range of computer systems instead of just one (e.g., Windows). Programmers often pick up the idioms, tricks and methodologies for developing cross-platform software through sheer trial and error, as they encounter the same mistakes and patterns of code over time. If you're an intermediate-to advanced-level programmer who'd rather cut to the chase, Write Portable Code contains the lessons, patterns and knowledge you'll need for developing cross-platform software.

Write Portable Code explains how to:

  • avoid common portability mistakes when starting out a new project, thereby saving time when a port must occur
  • re-factor existing, non-portable code so that it can be easily transplanted to new platforms
  • find bugs masked by platform specific behaviors

Programmers who avoid becoming married to a specific development environment or target platform greatly expand the target market for their software products. Whether you design cross-platform software from the ground up or have to move large amounts of code from one platform to another, the information contained in Write Portable Code will help you achieve your goals and grow as a programmer.

TOC
Preface
IntroductionChapter 1: Preparing for PortabilityChapter 2: ANSI C/C++Chapter 3: Techniques for PortabilityChapter 4: Editing and Source ControlChapter 5: Processor DifferencesChapter 6: Floating PointChapter 7: PreprocessorChapter 8: Compiler QuirksChapter 9: User InteractionChapter 10: NetworkingChapter 11: Operating SystemsChapter 12: Dynamic LibrariesChapter 13: Security and PermissionsChapter 14: File SystemsChapter 15: Scalability and PortabilityChapter 16: Portability and DataChapter 17: Internationalization and LocalizationChapter 18: Scripting LanguagesChapter 19: Cross-platform Libraries and Toolkits
Appendix A: POSHAppendix B: The Simple Audio LibraryAppendix C: The Rules for PortabilityReferences

Customer reviews

3.9 out of 5 stars
13 global ratings

Top reviews from the United States

Reviewed in the United States on June 9, 2015
This book does a really great job at talking about code portability. It definitely was an eye opener. However, it started loosing me around chapter five so I paused to increase my knowledge of programming and I will return it to later when my programming understanding increases.
Reviewed in the United States on February 19, 2006
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.
18 people found this helpful
Report
Reviewed in the United States on October 2, 2011
I would not recommend this book for an experienced programmer. If you know that sizeof(int) can vary, CRLF vs LF differences on Windows and Unix, and what little-endian is to network programming then you are already know enough to not need this book.

But if you are new to C/C++ programming or a student, then this book is likely a good read. The majority of the book builds awareness of portability issues, programming in the large, and common tools for professional programming (in the context of C/C++).

In 2011, I find that most of my C an C++ compatibility issues across operating systems are largely resolved by using STL and including <stdint.h>. The latter was not standard in 2005 (when the book was published) as it is today. As such, the book spends time explaining issues that are easily resolved by relying on these include files and libraries. There is a framework library implemented in the book called "Posh" (Portable Open Source Harness) that repeats much of <stdint.h> along with some functions that handle endian-ness and floating point variations between processors. Ironically, the book fails to mention Boost, which is a popular starting point for portable C++ development.

The harder C/C++ compatibility issues aren't easily resolved with header file macros. The real challenges of portable coding come from the fact that graphics, threading, I/O, networking, and APIs for making system calls vary widely between different flavors of Unix, Linux, and Windows. To which the book makes an effort to raise attention to, but very little effort on actually solving. The chapter on networking is 6 pages and doesn't go beyond declaring #defines for the subtle differences between Winsock and Unix sockets. Good luck trying to reconcile ePoll and IOCP, or the difference socket ioctl calls between platforms. The book rarely goes deep on any specific area of programming.
4 people found this helpful
Report
Reviewed in the United States on August 18, 2005
"Write Portable Code" is not just about writing code that ports from one OS to another or from one architecture to another; it's about writing code that will handle new feature requests, minor OS upgrades, and minor hardware differences. The author fills the book with a surprising amount of information on different storage formats, different C and C++ standards and different OS-dependent APIs for such a small book.

No book could cover every possible detail of every possible software port. Instead, the author focuses on the right attitude towards writing portable code. He demonstrates by example in each chapter, with C and C++ code you can download from his web page. Although the author focuses on C and C++ for the purpose of this text, the principles apply to any language, even supposedly portable languages like Perl.

It's not an expensive book for what you get. Even the most experienced programmer should find plenty to use here. The author's prose is easy and fun to read, and I laughed out loud more than once at some of his examples.

I recommend this book for all programmer levels.
3 people found this helpful
Report
Reviewed in the United States on August 22, 2016
Though the material is a little dated, this is well-written and a pretty easy read. The author answered a few questions I had via email.
Reviewed in the United States on December 31, 2013
Lots of good info about specific low-level system differences for C/C++ program implementations across platforms. Book lightly hits more modern forms of portability (internationalization/localization) but is very centric to the pains encountered with C/C++ porting.

8 years old, but still a good read.
Reviewed in the United States on July 28, 2005
As a full time system administrator I don't get much chance to program, but on occasion I have to write little utilities that something like Python or Perl might be too slow for. The problem is that I work on a mixed network of Solaris, AIX, Linux, and Windows machines, and since I'm not a full-time coder it takes me a long time to figure out how to get something working on one machine to work on another. Write Portable Code has been a great resource and I've already avoided a few potential hair pulling bugs that I didn't even know were bugs!

My only complaint is that it doesn't get into deep details about moving stuff like sockets from Linux to Windows, but if Mr. Hook did this I'm sure the book would be 2000 pages long.

I'm surprised no one has written a book on this topic yet, but I'm glad this one is available now.
3 people found this helpful
Report

Top reviews from other countries

Translate all reviews to English
Lena Schimmel
4.0 out of 5 stars Solides Buch, aber nichts bahnbrechend Neues
Reviewed in Germany on January 7, 2009
Das Buch geht Systematisch vor: Was ist eigentlich Portabilität, welche genrellen Konzepte gibt es, welche Bereiche der Programmierung benötigen besondere Aufmerksamkeit?

Im Vorwort wird noch betont, dass es sich an Programmierer aller Sprachen wendet, dennoch liegt der Fokus eindeutig auf maschinen-nahen Sprachen wie C und C++. Das sollte aber auch nicht verwundern, schließlich kann man hier im Bezug auf Portabilität am meisten falsch machen.

Etwa die Hälfte des Buches wird damit für z.B. Java-Programmierer komplett uninteressant - was aber nichts daran ändert, dass die andere Hälfte viel wissenswertes enthält, das man wohl in kaum einem anderen Buch findet.

Meiner Meinung nach ein Buch für jeden Programmierer, der bessere Software schreiben möchte und/oder langfristig erfolgreich sein möchte. Denn zum einen ist Software, die man nach den Richtlinien dieses Buches schreibt, nicht nur portabler, sondern auch Fehlerfreier und besser Wartbar. Zum anderen haben Viele Programme einen Lebenszyklus von mehr als zehn Jahren, und in einer Dekade ändern sich Plattformen stark - und fast jede Software wird früher oder später auf eine andere Plattform umziehen müssen. Der Autor begründet überzeugend, warum man sich darauf in jedem Fall so früh wie Möglich vorbereiten sollte.

Was die Menge der angesprochenen Problemfelder angeht, so macht das Buch einen sehr vollständigen Eindruck - und es gibt mehr Problemfelder, als man sich erträumen mag. Bei den Lösungen hapert es manchmal ein wenig, aber ein Problem zu identifizieren ist ja bekanntlich der schwerste Teil der Lösung.

Wer nun aber hofft, etwas über Bibliotheken und Frameworks zu erfahren, die Plattformunabhängigkeit erleichtern, wird herbe enttäuscht: Das Kapitel umdasst nichtmal zweieinhalb Seiten. Hier hätte man sicher mehr draus machen können, vielleicht sogar ein ganzes Buch für sich.

Wer sich in der Theorie schon ein wenig mit Plattformunabhängigkeit befasst hat, wird auch nichts bahnbrechend Neues erfahren. Als solide Zusammenfassung dessen, was man sowieso schon mal irgendwo gehört hatte und wahrscheinlich auch schon wieder vergessen hatte, ist das Buch aber bereits sein Geld wert.

Und wer sich bisher noch keine Gedanken über Plattformunabhängigkeit gemacht hat, sollte vielleicht jetzt damit anfangen. Am besten mit diesem Buch.