🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: net.lang.c++
Article #353

Long Identifiers for C++

#353
From: Bjarne Stroustrup
Date: Tue, 14 Oct 1986 16:45
32 lines
1835 bytes
> Path: ..!watnot!cgoudeseune (center of gravity @ U of Waterloo, Ontario)
> I hear all these complaints that most C's only support 8-character
> identifiers, and the C++ preprocessor *needs* thirty-two.

These days I think most C compilers do support many characters (Unix SysV,
BSD, and derivatives have VERY long names, Microsoft, DEC, and others support
31 characters). C++ prefers arbitrary long names, but you can live with 31
if you have to. 

> Say we use only 7-character letters-only identifiers.
> 26^7 = 8 031 810 176.
> Seeing as how any C++ preprocessor is unlikely to produce over 8 billion
> different identifiers, is there a good reason why a little filter couldn't
> be inserted between C++'s output and C's input to shrink the size of these
> huge identifiers to a manageable size.

There are two practical snags here:

	(1) separate compilation: you don't know what identifiers are used in
	    other separately compiled programs so that it is hard, but  not
	    impossible to make up unique names.

	    > Sure, it's slow; we've got a 8 MHz 68000.
	    > Sure, it's a kludge; it works! (I hope)

	    It does indeed. I once had a version that did it.
	    However, you will not like it, because

	(2) having encrypted your identifiers you'll find it impossible to use
	    a debugger.

Don't accept short names if you have any choice at all.
Technical Details
Message-ID: <6178@alice.uUCp>
Path: arc1-ca.pugleaf.net!utzoo!watmath!clyde!bellcore!ulysses!allegra!alice!bs

Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: arc1-ca.pugleaf.net!utzoo!watmath!clyde!bellcore!ulysses!allegra!alice!bs
From: bs@alice.UucP (Bjarne Stroustrup)
Newsgroups: net.lang.c++
Subject: Long Identifiers for C++
Message-ID: <6178@alice.uUCp>
Date: Tue, 14-Oct-86 12:45:36 EDT
Article-I.D.: alice.6178
Posted: Tue Oct 14 12:45:36 1986
Date-Received: Fri, 17-Oct-86 10:03:23 EDT
Organization: Bell Labs, Murray Hill
Lines: 32