Newsgroups: comp.std.c Path: utzoo!henry From: henry@utzoo.uucp (Henry Spencer) Subject: Re: Significant name length list Message-ID: <1989Jul23.021533.27429@utzoo.uucp> Organization: U of Toronto Zoology References: <2146@dlvax2.datlog.co.uk> <12570020@hpclscu.HP.COM> <116@psitech.UUCP> Date: Sun, 23 Jul 89 02:15:33 GMT In article <116@psitech.UUCP> david@psitech.UUCP (david Fridley) writes: >Requiring there to be a maximum name length is the sign of an inexperienced >programmer. It is a simple process to tag each symbol with its length and >realloc() the block untill it is big enough for any symbol... Claiming that "it's simple to do it right, so everyone should do it that way" is the sign of someone who never maintains other peoples' software. :-) As I understand it, the reason why ANSI C *encourages* unlimited-length names but *permits* a limit of 31 significant characters for internal names (we won't get into the external-name mess again...) is to make it easy to retrofit existing compilers that were not built for unlimited-length names. Nobody with any sense is going to implement a fixed limit in a new compiler, but s/8/31/g is a whole lot easier than changing fixed-length tables to use malloc, especially if you've got a tight deadline and a lot of more serious ANSI-compatibility problems to worry about. -- 1961-1969: 8 years of Apollo. | Henry Spencer at U of Toronto Zoology 1969-1989: 20 years of nothing.| uunet!attcan!utzoo!henry henry@zoo.toronto.edu