Path: utzoo!attcan!uunet!peregrine!elroy!ames!pasteur!ucbvax!hplabs!hp-pcd!hplsla!jima From: jima@hplsla.HP.COM (Jim Adcock) Newsgroups: comp.lang.c++ Subject: Re: goodbye cpp ??? (macros vs. inline functions) Message-ID: <6590073@hplsla.HP.COM> Date: 28 Nov 88 18:43:41 GMT References: <3637@pt.cs.cmu.edu> Organization: HP Lake Stevens, WA Lines: 56 My apologies to those people who read my original "catchy title" [goodbye cpp] and turned on the flames without reading what I was proposing. In summary, what I was proposing: 1) Get parameterized classes into C++ compilers, so that people don't have to use cpp to implement ultra-kludge hack "cpp-parameterized" classes. 2) Add some kind of import/export capability to the language so that one isn't forced to play a bunch of hack games with .h files, multiple #includes, to "optimize" the compilation process, where these would be simple for the compiler to handle if there were import/export capabilities in the language. My claim is that one would still want some kind of import/export capabilities even if one had an "integrated programming environment" ala Smalltalk. 3) Make sure in-line functions work in C++ compilers and are in fact in-lined where to do so would represent a "reasonable" optimization. 4) Make sure that C, C++ compilers have enough "optimization-sense" that they do not generate obviously dead code: if (0) { /* lines of code */ } shouldn't generate any more code in a C or C++ compiler in 1988 than: #if 0 /* lines of code */ #endif [If your C or C++ compiler in 1988 isn't at least as smart as cpp in performing these kinds of "optimizations" -- you've got problems! :-] 5) Allow continued access to cpp for those people who need it for backwards compatibility, or because they have some "valid" reason to hack source code. [Just don't do anything that forces the rest of us to use it.] Cpp could be accessed via a compile-time option, for example. Or you could contiue to allow use of cpp be default, and give the rest of us a compile time option to turn off recognition of cpp constructs. 6) Recognize cpp as not being part of the C++ language, but rather is a text preprocessor, which may or may not be integrated into the first pass of a C++ compiler. Use of cpp may be necessary occasionally, as assembly is necessary occasionally, but continual use of cpp in every day tasks -- such as specifying what classes and libraries a new class is to be built upon, demonstrates features missing from the C++ language. 7) Recognize the C++ language is distinct and different from [but related to] any particular implementation of C++ on any operating system, using any C++ compiler, or combination of "translator" and C compiler.