Tools for manipulating message catalogs

Charles Bryant ch at dce.ie
Fri Apr 19 20:39:05 AEST 1991


In article <1991Apr10.122642.3991 at dg-rtp.dg.com> eliot at dg-rtp.dg.com
advocates the use of integer constants to identify messages in a message
catalogue. Many others argue that symbolic names are better.

I have never used such a thing, but I assume the choice is between
	MSG_NUMTOOBIG	"Number too big"
which is processed into:
	#define MSG_NUMTOOBIG	1
which then gets used in the program instead of the string, and
	1	"Number too big"
and then `1' gets used in the source.

I hope everyone would agree that:
	a) symbolic names allow messages to get out of sync with the
	program (e.g. swap two lines in the message file, or add a new
	one in the wrong place)

	b) it is easy to forget or get confused over which number
	corresponds to each message

Why not get the benefits of both? Have the input be:
	1	MSG_NUMTOOBIG	"Number too big"
which produces the #defines as before. The programmer can now use a
meaningful symbolic name, and cannot renumber without making the same
change to the message file as would be necessary if no symbolic name is
used.
-- 
Charles Bryant (ch at dce.ie)
--
If you like the opinions expressed in this message, they may be available
for rent - contact your local sales office. Low interest deals available.



More information about the Comp.unix.programmer mailing list