Thread View: net.lang.c++
1 messages
1 total messages
Started by Bjarne Stroustrup
Tue, 14 Oct 1986 16:45
Long Identifiers for C++
Author: Bjarne Stroustrup
Date: Tue, 14 Oct 1986 16:45
Date: Tue, 14 Oct 1986 16:45
32 lines
1835 bytes
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.
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads