kaz@helios.crest.nt.com (Kaz Kylheku) writes: >No. C is perceived as being portable. Those who perceive C++ as portable >are naive or mistaken. >In article <3459AC95.1D75@dynamite.com.au>, >Alan E & Carmel J Brain wrote: >>Now C++ on the other hand, written using CodeWarrior 10 on a Mac, ported >>to CodeWarrior 10 on an IBM... or even MVC++ 4 vs MVC++ 5... or worse >>still CodeWarrior 9 on a Mac to CodeWarrior 10 on a Mac to MVC++ 5 on an >>IBM... In 15,000 LOCs of C++ how many would you reasonably expect to >>have to be changed? (yes, these were actual examples too) Let me provide a data point. I am using a modern UNIX system, based on an architecture that has been around for 10 years or so. We have the very latest C++ compiler from the vendor. We have another C++ compiler. I picked up the September 1997 issue of the C/C++ Users Journal, and downloaded all of the source code for that issue. How many of the C++ programs could I compile? NONE OF THEM. I got one of them working after about half an hour of hacking; the others defeated me. Porting from one version of CodeWarrior to another is no real test of portability; no test at all really. C++ compiler differences are *much* bigger than machine differences. Porting from one version of MVC++ to another is no real test of portability; no test at all really. C++ compiler differences are *much* bigger than machine differences. Porting between CodeWarrior and MVC++ *is* a test of portability, but it still is a rather pathetic test. If I had to port 15 kSLOC of C++ from a Mac or a PC to this system, I would expect major changes to every translation unit and minor changes to every class. I would not be in the least suprised if a week's work led to total failure. I am aware of several C++ projects which have had to abandon initial plans to release the code on more than one machine; there was one commercial development started here that ran into that very problem last year, and another up the road the year before. Let's just take a few of the things I'm seeing in C++ these days that are NOT supported by all compilers: namespace mutable explicit static data members initialised in a class definition template<> (that is, a template with no parameters). >Even though it's easy to introduce machine dependencies into C or C++ code, I >would expect that most of your C++ headaches would be related to a lack of >standardization, or the different pace of adaptation of the draft features by >various vendors. (That alone is, to me, reason enough to avoid C++ if I can). That is precisely the problem. >Then there are uses of non-portable functions that are not in the standard >library. E.g. it's impossible to port an XWindow application to Microsoft >Windows without rewriting portions of it, but it's not really the fault of the >underlying language. (A) Let us all thank and praise Ousterhout for Tk. (And there's an Ada/Tk interface. Portable GUIs in Ada.) (B) There's an outfit called Mainsoft (www.mainsoft.com) selling something called MainWin, which they claim lets you run NT code under UNIX. I know _nothing_ about the company or their products other than what I've seen in their ad. Anyone know how well it works with the Ada Win32 binding? -- John �neas Byron O'Keefe; 1921/02/04-1997/09/27; TLG,TLTA,BBTNOTL. Richard A. O'Keefe; RMIT Comp.Sci; http://www.cs.rmit.edu.au/%7Eok