Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!chaph.usc.edu!alcor.usc.edu!jeenglis From: jeenglis@alcor.usc.edu (Joe English) Newsgroups: comp.unix.programmer Subject: Re: Tools for manipulating message catalogs Message-ID: <16588@chaph.usc.edu> Date: 14 Apr 91 17:47:32 GMT References: <1991Apr10.122642.3991@dg-rtp.dg.com> <1991Apr11.084924.1951@alphalpha.com> <1991Apr12.122701.9545@dg-rtp.dg.com> Sender: news@chaph.usc.edu Organization: A child, an elderly man, a Cuban Lines: 29 Nntp-Posting-Host: alcor.usc.edu eliot@dg-rtp.dg.com writes: >In article <1991Apr11.084924.1951@alphalpha.com>, nazgul@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@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.