Path: utzoo!attcan!uunet!lll-winken!lll-tis!ames!think!barmar From: barmar@think.COM (Barry Margolin) Newsgroups: comp.lang.c Subject: Re: hardcoded constants Message-ID: <33459@think.UUCP> Date: 14 Dec 88 17:16:47 GMT References: <1988Dec8.173158.11839@utzoo.uucp> <846@starfish.Convergent.COM> <9134@smoke.BRL.MIL> <1988Dec13.172306.16195@utzoo.uucp> Sender: news@think.UUCP Reply-To: barmar@kulla.think.com.UUCP (Barry Margolin) Organization: Thinking Machines Corporation, Cambridge MA, USA Lines: 13 In article <1988Dec13.172306.16195@utzoo.uucp> henry@utzoo.uucp (Henry Spencer) writes: >The policy we try to follow is that if you must hard-code a constant, >then it must be accompanied by a comment explaining why that particular >number is there. 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. Barry Margolin Thinking Machines Corp. barmar@think.com {uunet,harvard}!think!barmar