Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.milw.wisc.edu!uakari.primate.wisc.edu!ctrsol!ginosko!uunet!mcvax!piring.cwi.nl!guido From: guido@piring.cwi.nl (Guido van Rossum) Newsgroups: comp.lang.c++ Subject: Re: A question of style Keywords: define const enum Message-ID: <8300@boring.cwi.nl> Date: 1 Aug 89 07:44:02 GMT References: <1148@hsfmsh.UUCP> Sender: news@cwi.nl Lines: 26 Stroustrup, in his book, says that you shouldn't be using preprocessor features where the language has corresponding features. This rules out using #define for simple constants. (My own question: would this hold for #ifdef'ed code, too? I could do something like const debug = ...; . . . foo() { if (debug) printf("foo called\n"); ... } but I'm a bit worried about dumb (but otherwise OK) compilers that leave the code in; e.g., for some C compilers, with -O, the code disappears but the strings remain in the data segment.) -- Guido van Rossum, Centre for Mathematics and Computer Science (CWI), Amsterdam guido@cwi.nl or mcvax!guido or guido%cwi.nl@uunet.uu.net "You're so *digital*, girl!" -- Neneh Cherry