[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Why are people so afraid of globals?
- From: Florian Weimer <fw@...>
- Date: Sun, 11 Jul 2010 16:29:05 +0200
* David Manura:
> The problems with C header files [1] are well known, and newer
> variants like Java/C#/D do not repeat it. windows.h, for example, is
> prone to some annoying name conflicts [2]. Design patterns have been
> devised to reduce these problems sufficiently to make large
> application development do-able. Modern C++ development does use
> namespaces [3], although this does not replace header files. Even C
> has "static" internal linkage, a type of private namespace, and a
> convention is to prefix globals by the library name (e.g. "lua_") and
> hope it is unique.
Many modern platforms can resolve conflicts with certain linker
tricks, too (symbol versioning, hidden visibility, and other stuff).
Conflicts between preprocessor symbols remain a bit problematic,
though.