Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!taumet!steve From: steve@taumet.com (Stephen Clamage) Newsgroups: comp.lang.c++ Subject: Re: Naming Conventions Message-ID: <556@taumet.com> Date: 18 Jan 91 18:33:24 GMT References: <60352@microsoft.UUCP> <278D1767.505@tct.uucp> <61785@brunix.UUCP> Organization: Taumetric Corporation, San Diego Lines: 18 jhc@irwin.uucp (James H. Coombs) writes: >Recently, I had a class with something like > static const u_short kOrig; >Since the constant was known only within the scope of my class, I >thought that it was as well protected from collisions as possible. But >it turned out that a developer had done something like: > #define kOrig 8 This is a primary reason not to use #define's in C++ code. Constants and inline functions give you what you need for anything but conditional compilation. -- Steve Clamage, TauMetric Corp, steve@taumet.com