Tools for manipulating message catalogs

Joe English jeenglis at alcor.usc.edu
Mon Apr 15 03:47:32 AEST 1991


eliot at dg-rtp.dg.com writes:
>In article <1991Apr11.084924.1951 at alphalpha.com>, nazgul at alphalpha.com (Kee Hinckley) writes:
[...]
>|> Not only does my gencat create .h files, it also allows me to
>|> create a catalog that doesn't specify any numbers at all - it generates
>|> them automatically.
>So instead of having to type in numbers, you have to type in symbolic names.
>Why is this any easier?  Symbolic names are an advantage when you want to be
>able to change the underlying value later on.  I claim that with message
>numbers, you shouldn't change those values!  These numbers should be CONSTANTS!

You never want to change the value of pi either [*], but
most programmers prefer to use a symbolic constant rather
than a numeric literal.   I agree with the statement that
1 and 0 are the only two numeric literals that should appear
in a program; every other magic number should be given a
symbolic value.  Especially in a situation like message catalogs,
where the number itself is an arbitrary constant with no
intrinsic meaning of its own.


--Joe English

  jeenglis at alcor.usc.edu

  [*] This isn't entirely true: if you port a program from
  a machine with 64-bit doubles to one with 128-bit doubles,
  then the representation of PI *will* change.  Something
  like SIGINT or SEEK_END would be a better example.



More information about the Comp.unix.programmer mailing list