Emulating C++ coding style
Tres Seaver
tseaver at palladion.com
Thu Apr 29 00:21:41 EDT 1999
William Tanksley wrote:
>
> On Fri, 23 Apr 1999 13:28:12 +0100, Alan Gauld wrote:
<<snip>>
>
> >> In proper C++, your const will be contained inside a class (probably
> >> static) to keep it out of the global namespace.
>
> >Hopefully not. It should be contained within a C++ namespace.
>
> Okay, I'll bite. Why "hopefully not" a class? I know namespaces are new
> and cool, but classes seem to have done the job very well in the past.
> Have they been secretly causing bloat in our code all along ;-)?
Classes are semantically "heavier" than namespaces: by design, they exist to
classify objects. Classes which exist only to scope other names (typedefs,
constants, free functions), while a decent workaround before the ANSI standard,
are now less attractive (they can't be reopened, for one thing).
--
=========================================================
Tres Seaver tseaver at palladion.com 713-523-6582
Palladion Software http://www.palladion.com
More information about the Python-list
mailing list