Path: utzoo!attcan!uunet!ncrlnk!ncrcae!hubcap!gatech!uflorida!mailrus!iuvax!bobmon From: bobmon@iuvax.cs.indiana.edu (RAMontante) Newsgroups: comp.lang.c Subject: Re: hardcoded constants Message-ID: <15852@iuvax.cs.indiana.edu> Date: 16 Dec 88 14:47:42 GMT Reply-To: bobmon@iuvax.UUCP (RAMontante) Organization: malkaryotic Lines: 26 henry@utzoo.uucp (Henry Spencer) writes: - -Trouble is, often it's almost impossible to devise a meaningful name. -I'm not talking about hard-coding things like choice of control characters, -but about things like (in a function to concatenate two strings with a -'/' in between): - - foo = malloc(strlen(a)+strlen(b)+2); /* 2 for '/' '\0' */ - -Now, what's a good name for that "2", and how does naming it improve -readability? #define STRING_TERMINATOR_LENGTH 2 is descriptive, but I think only a fanatic Pascalist could love it. And only somebody with a more-than-80-column display would want to use it. more-fun-with-Henry's-signatures follows: -- -"God willing, we will return." -Eugene Cernan, the Moon, 1972 I like it, but it's not obvious whether God understands "we" to mean "Americans". Neil Armstrong had to go and get ecumenical with his "...giant leap for mankind". And now it's those godless communists who have a space station...