NULL as a string terminator

Rhodri James rmj at tcom.stc.co.uk
Wed Aug 22 00:08:22 AEST 1990


In article <3585 at goanna.cs.rmit.oz.au> ok at goanna.cs.rmit.oz.au (Richard A. O'Keefe) writes:
}In article <1990Aug20.000227.12867 at icc.com>, cbp at icc.com (Chris Preston) writes:
}(quoting a quote)
}> >#define	FOO_BAR_ERROR	"foo bar error"
}> >#define UNDEF_BAZ_ERR	"undef baz err"
}> >
}> >I cringe when I come across code like this.  Needlessly removing objects
}> >a level is distracting and gains nothing.
}
}and then defends this, where there are conditional definitions.
}>   #if MSDOS
}>   #define DATACOM_NOT_INIT "Execute datacomm.exe and restart the program"
}>   #elif  SYSV
   [etc]
}as an example of a Good Thing.  I cringe when I see code like this too.
}For why?  Internationalisation, _that's_ for why.

I cringe when I see this (unwords like "internationalisation", I mean).
I take it that by that you mean converting strings in code to foreign
languages ("an act of making something international", as if it did any
such thing). Also I fail to see your point. Surely such #ifdef switching
as above is more efficient, simpler to maintain and more legible than
the scrabbling about with resource files you prefer? I know which I
would rather do of running pre-preprocessing or just compiling with
"-DFRENCH".

}>   It also impacts on the reusability of code.  Pay me now or pay me later.
}
}Considering the large negative impact on internationalisation of having
}fixed strings in the program, may we _bill_ him, I wonder?

Demonstrate to me a negative impact on internationalisation (ugh) and I
might believe you. Any negative impact will do, I'm not too choosy.
-- 
* Windsinger                 * "Nothing is forgotten..."
* rmj at islay.tcom.stc.co.uk   *                    Mike Whitaker
*     or (occasionally)      * "...except sometimes the words"
* rmj10 at phx.cam.ac.uk        *                    Phil Allcock



More information about the Comp.lang.c mailing list