[net.lang.c] C Portability

cottrell@NBS-VMS.ARPA (COTTRELL, JAMES) (02/28/86)

/*
> The point about the "C" being as portable as Stonehenge was made NOT to
> imply that programs should be routinely written in Assembler Language
> (pun not intended), but rather that porting of programs written in "C"
> has its own different set of problems, the solution to some of which are
> noted above.  This is very obvious to organizations, such as mine, that
> distribute "C"-based software for use on many different host systems, all of
> which allegedly have "standard UNIX" and "standard C" (whatever "standard"
> means these days).

If it didn't have `it's own set of problems' your company wouldn't 
exist. Do you think all you have to do is show up at your customer's
site with tar tapes, run a `make install, & go home? Any fool can do that.
 
> Of course, we would never be able to distribute our software for so many
> different host systems if we were required to write the code in Assembler,
> but, on the other hand, we must go through significant coding gymnastics to
> assure the portability including sticking to the "least common multiple" of
> language features and "detuning" programs due to the compiler restrictions
> (authors call them features, of course) on some systems.  We don't have the
> luxury of telling our customers "too bad, your system doesn't have a good
> or standard enough C compiler!"

Ever heard of `#ifdefs'? That way you can write your code for a `normal'
machine & your favorite environment, then put in #ifdefs for other
environments. You may not have the luxury of telling your customers
too bad (you must not be from SUN :-), but you *can* charge them a 
different price for your services. After all, it's the weird ones
that make it harder, let *them* pay for it.

	jim		cottrell@nbs
*/
------

SofPasuk@imagen.UUCP (Munach Rvi'i) (03/05/86)

> /*
> > The point about the "C" being as portable as Stonehenge was made NOT to
> > imply that programs should be routinely written in Assembler Language
> > (pun not intended), but rather that porting of programs written in "C"
> > has its own different set of problems, the solution to some of which are
> > noted above.  This is very obvious to organizations, such as mine, that
> > distribute "C"-based software for use on many different host systems, all of
> > which allegedly have "standard UNIX" and "standard C" (whatever "standard"
> > means these days).
> 
> If it didn't have `it's own set of problems' your company wouldn't 
> exist. Do you think all you have to do is show up at your customer's
> site with tar tapes, run a `make install, & go home? Any fool can do that.
>  
> > Of course, we would never be able to distribute our software for so many
> > different host systems if we were required to write the code in Assembler,
> > but, on the other hand, we must go through significant coding gymnastics to
> > assure the portability including sticking to the "least common multiple" of
> > language features and "detuning" programs due to the compiler restrictions
> > (authors call them features, of course) on some systems.  We don't have the
> > luxury of telling our customers "too bad, your system doesn't have a good
> > or standard enough C compiler!"
> 
> Ever heard of `#ifdefs'? That way you can write your code for a `normal'
> machine & your favorite environment, then put in #ifdefs for other
> environments. You may not have the luxury of telling your customers
> too bad (you must not be from SUN :-), but you *can* charge them a 
> different price for your services. After all, it's the weird ones
> that make it harder, let *them* pay for it.
> 
> 	jim		cottrell@nbs
> */
> ------

Yes, we would like to be able to send out a "tar" / "cpio" tape with source,
have the customer type a single command, answer a question or two, and have
the package install itself without further user intervention.  That is indeed
what "real" users, not computernerds, really want.  They were sold UNIX as a
totally portable solution and believe something is wrong with an application
software developer if their software doesn't run on every single variant of
UNIX.  They don't understand and don't want to know about the differences
between BSD and ATT versions and all the silly, religious bickering and
mutual incompatibilities.

And yes, we've heard of "#ifdefs" - problem is that we need too many of them
to get around the major incompatibilities.

Mr. Cottrell, in the real world, you try telling a customer that THEIR system's
version of UNIX is the "wierd one" - good way to lose a customer ...