Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!cmcl2!rutgers!cbmvax!daveh From: daveh@cbmvax.UUCP (Dave Haynie) Newsgroups: comp.lang.c Subject: Re: MAJOR ANSI C FLAW (my opinion, of course) Message-ID: <2481@cbmvax.UUCP> Date: Tue, 13-Oct-87 14:53:29 EDT Article-I.D.: cbmvax.2481 Posted: Tue Oct 13 14:53:29 1987 Date-Received: Thu, 15-Oct-87 05:46:29 EDT References: <8754@utzoo.UUCP> Organization: Commodore Technology, West Chester, PA Lines: 49 in article <8754@utzoo.UUCP>, henry@utzoo.UUCP (Henry Spencer) says: > Keywords: external names, length, bogosity to the max > >> ... If I stick to a 6 char external minimum, my coding >> style and readability will be severely compromised. Ever try to provide large >> numbers of MEANINGFUL identifier names with a 6 char limit???? > > Oh, nonsense. It's a pain, yes, but it's not that hard, unless you belong > to the school that thinks that "NumberOfCharactersInString" is somehow more > meaningful than "nchars". Everything I code has external names unique in > the first six characters (note that you *can* use more, you just have to > ensure uniqueness). Once in a long while it makes me grit my teeth and > use a less-than-ideal name. Big deal. > -- It's more than just a pain, it's downright undoable in many cases. Like, for instance, when your operating system has 500-2000 meaningful names of it's own, and you're expecting all these names to be meaningful AND unique to 6 characters, while at the same time you on your own must come up with new 6 character global names that don't conflict with other names used in the system. Can you say 1975? No modern computer system imposes such limitations, and no modern language should impose them. Especially C, which has problems in this area that more modern languages don't. For example, "nchars" may be just as meaningful as "NumberOfCharactersInString", providing that strings are the only thing in which the number of characters has any meaning. But as soon as you add other data types that also have a number of characters rating, you're screwed. C++ could use "nchars" for every data type, but in C you'd have to do something like snchars, bnchars, lnchars, qnchars, etc. instead of something more reaable like "LengthString", "LengthBuffer", "LengthLine", "LengthQueue", etc. And really, if the spec states that 6 chars minimum are significant, everyone will support whatever they would anyway, and system that have a maximum of 6 characters are out of luck. If they state that 6 significant characters is the standard, most compilers will default to the normal maximum of that OS/machine, and offer 6 as a compiler options, just as many C compilers today offer an 8 significant character mode. So systems that only work with 6 are again out of luck. Regardless of what politics says, 6 character just aren't enough for most systems, and no one's going to use them unless they have to. So those political folks are only fooling themselves. A more realistic approach would be to say to these guys, "the standard is A_LIVABLE_MINIMUM_LENGTH"; if you don't like it, wake up and smell the tost burning, pal. This isn't 1975! Hell, even my C64 C-linker handler more than 6 significant characters! > "Mir" means "peace", as in | Henry Spencer @ U of Toronto Zoology > "the war is over; we've won". | {allegra,ihnp4,decvax,utai}!utzoo!henry -- Dave Haynie Commodore-Amiga Usenet: {ihnp4|caip|rutgers}!cbmvax!daveh "The B2000 Guy" PLINK : D-DAVE H BIX : hazy "Computers are what happen when you give up sleeping" - Iggy the Cat