Significant name length list

Henry Spencer henry at utzoo.uucp
Sun Jul 23 12:15:33 AEST 1989


In article <116 at psitech.UUCP> david at 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 at zoo.toronto.edu



More information about the Comp.std.c mailing list