View Single Post
Old Nov 21st, 2005, 3:59 PM   #5
lectricpharaoh
Caffeinated Neural Net
 
lectricpharaoh's Avatar
 
Join Date: Jun 2005
Location: Dry west coast of Canada
Posts: 1,010
Rep Power: 5 lectricpharaoh will become famous soon enough
The simple answer is that a namespace is a context in which symbols (names of variables, functions, classes, etc) reside. It is similar to how you might refer to your house as 'home', and I refer to mine as 'home'. Yet when you say 'home', I don't think you're talking about my house, and vice versa. In C++ syntax, we would refer to those symbols as BrinyCode::home and lectricpharaoh::home. The full name allows us to avoid the ambiguity that would otherwise occur. C++ namespaces are a mechanism for resolving such ambiguities in code. Other languages have their own mechanism, such as packages in Java, that perform pretty much the same job. Some languages, like C, don't have any such mechanism, which means you're more likely to run into naming conflicts.

For a more comprehensive discussion, see the link that DaWei posted.
__________________
And once again, Probability proves itself willing to sneak into a back alley and service Drama as would a copper-piece harlot.
- Vaarsuvius, Order of the Stick
lectricpharaoh is offline   Reply With Quote