Ivan Krstić wrote: > On Jun 8, 2008, at 12:47 AM, Karl Robillard wrote: >> "I will write portable code, which does not assume any specific CPU or >> OS, so as to respect the users right to run my software on many >> different systems." > > > CPU, maybe, but writing OS-portable code is another matter entirely. > With low-level code, OS portability does not require the _absence_ of > some action (making assumptions about a specific OS), but a very strong > _presence_ of a dedicated effort to keep up with a pile of mutually > incompatible systems. It's reasonable to hold programmers to an > understanding of endianness and writing 64-bit clean code, yes, but "not > assuming a particular OS" is a pipe dream. Even if you follow POSIX to > the letter, you'll find yourself special-casing behavior across Solaris, > Linux and *BSD, and just about every subsystem on Windows. >
Keeping with Ivan's line of thinking: The only way to write portable code is to port it. If you are really paranoid about the future, write a function around every system call you make, even if its just a pass-through. When you are done you'll end up rewriting CYGWIN. :) Worked with a programmer who did just such a thing for an application that he knew he need to port between Solaris, NeXTSTEP and Windows. It was a lot of work, but it only paid-off after the project lasted 6 years. Kurt Stephens _______________________________________________ fonc mailing list [email protected] http://vpri.org/mailman/listinfo/fonc
