Path: utzoo!utgpu!attcan!uunet!lll-winken!lll-lcc!ames!mailrus!purdue!decwrl!megatest!djones From: djones@megatest.UUCP (Dave Jones) Newsgroups: comp.lang.c Subject: Re: hardcoded constants Message-ID: <1084@goofy.megatest.UUCP> Date: 14 Dec 88 22:52:17 GMT References: <33459@think.UUCP> Organization: Megatest Corporation, San Jose, Ca Lines: 12 From article <33459@think.UUCP>, by barmar@think.COM (Barry Margolin): ... > > My rule of thumb is that if it needs a comment, it should be a > manifest constant, not a hardcoded literal. The name of the constant > then serves as self-documentation. > Your thumb is okay with me, so long as you add the proviso that if the constant is only used in one place, its scope of definition is restricted to that place. I'll try to say that in English. I don't want the #define to be exiled to some #include file unless it really is used all over the place. If it is local, keep it local.