NULL as a string terminator

Chris Torek chris at mimsy.umd.edu
Wed Aug 22 21:38:17 AEST 1990


>In article <3585 at goanna.cs.rmit.oz.au> ok at goanna.cs.rmit.oz.au
(Richard A. O'Keefe) recommends against `#define'ing error strings
and recommends instead, e.g., reading them from a file:
>>For why?  Internationalisation, _that's_ for why.

In article <1881 at jura.tcom.stc.co.uk> rmj at tcom.stc.co.uk (Rhodri James)
writes:
>I cringe when I see this (unwords like "internationalisation", I mean).

Well, I am not particularly enamoured of polysyllabic neologisms
applied epideictically myself. :-)  But I evagate:

>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?

Efficient?  Probably so---but we are talking about an error handler
here.  (`My code handles 100,000 errors per second!  Of course it
only handles 10 non-errors per second....')  Simpler to maintain?
Perhaps.  More legible?  Not really; maybe even not at all:

>I know which I would rather do of running pre-preprocessing or just
>compiling with "-DFRENCH".

I do not understand why these are listed as the alternatives (what
`running pre-processing'?).  But given modern networks and systems,
it is not only possible, it is even likely that the same machine
will be used simultaneously from Japan, the USA, France, and Germany,
and the same utility (a single binary compiled in the UK) may have
to produce the same error message in four different languages, all
at the same time, with one of them in a 16-bit character set.

This is rather difficult to accomodate cleanly in the source---
particularly if one is called upon to add a new language every day
(for a week or two, then every few days, and eventually only one
a year or so).
-- 
In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 405 2750)
Domain:	chris at cs.umd.edu	Path:	uunet!mimsy!chris



More information about the Comp.lang.c mailing list