From Wikipedia, the free encyclopedia
  (Redirected from Talk:Namespace (computer science))
Jump to: navigation, search
WikiProject Computing (Rated Start-class)
WikiProject icon This article is within the scope of WikiProject Computing, a collaborative effort to improve the coverage of computers, computing, and information technology on Wikipedia. If you would like to participate, please visit the project page, where you can join the discussion and see a list of open tasks.
Start-Class article Start  This article has been rated as Start-Class on the project's quality scale.
 ???  This article has not yet received a rating on the project's importance scale.

Merge to namespace (computing) proposal[edit]

Is the word namespace really used in general like this article suggests it is? I thought it was more or less restricted to programming languages. Note that I am not saying the word couldn't or shouldn't be used in a more general context, I am just questioning whether it is or not already. If not, this is effectively primary research. Pcb21| Pete 00:14, 2 Jul 2004 (UTC)

Although Namespaces have strong applications in computer science to localize naming conventions, the term can be generically applied to most anything. Namespaces are even used inside the wiki system itself, as in the WoWWiki help files Help:Editing. Notice how I used a namespace to link to that. Tiranak 05:33, 24 April 2006 (UTC)

  • I completely agree; namespace is definitely a more general term. However, I would propose making a disambiguation link on the top of the page to the computer science term Metromoxie 01:54, 13 May 2006 (UTC)
    • Also, there hasn't been talk about this in a while, so I'm going to remove the tag in the next couple of days. Metromoxie 01:55, 13 May 2006 (UTC)

It's not restricted programming languages, but is is restricted to computing. Try finding it in any non-computing dictionary. Linking syntax in MediaWiki is a very poor example - it's a program! Try finding the term namespace used in any of the See Also links that aren't computing topics - it can be applied to those fields, but wouldn't be except by someone from a computing background. Also, C has no namespaces and no name-mangling. This article needs work. JonathanWakely 11:04, 2 November 2006 (UTC)

I also agree that the word namespace is restricted to computing. The paragraph which starts "Each language is a namespace..." is simply untrue. The same word can have several different meanings within each language. The example of family names as namespaces suffers from the same problem. I propose this article be redirect to Namespace (computer science). Mikecron 17:46, 18 April 2007 (UTC)

I take issue with the definition: the idea is to allow the same name to be reused in several different ways without ambiguity. Given the alphabet {a,b,c,...,x,y,z}, an infinite number of unique names can be generated, but only a few are used regularly, such as the letters {i,j,x,y,..} because long names are impractical. A prefix (or suffix), taken from the alphabet, creates a new set of names and disambiguates all names between the two. For example, the prefix 'aa' added to {i,j,x,y} becomes aa:{i,j,x,y}, which is distinct from {aai,aax,aay} and {i,j,x,y}. However, the prefix (or namespace), is itself a name in the original name set and similarly subject to regular use, such as {Help, Category, Template}. By creating a meta-namespace, such as 'bb', the same namespace 'aa' can be reused as bb:aa:{i,j,x,y}, which is different from bb:{aai,aaj,aax,aay}. It should clear that a file's path defines its unique namespace (e.g. /foo/bar/widget/) and all filenames in that namespace (i.e. directory) are unique. Similarly, a person's lineage can also be considered a namespace, although personal names are inherently ambiguous.

Namespaces do not provide context, it follows from uniqueness. Although the name i maybe used in both the global and aa namespaces, they are completely separate entities. So aa:i is not i used in the 'aa' namespace, but another item entirely, regardless of whether they are equal, similar, or different to each other. (PeterMG 20:54, 5 May 2007 (UTC))

I'd say this article is more than justified as whether or not the term "namespace" is only used in the computer sciences today or not it refers to a good and useful concept well adaptable to use outside the field. As taxonomy is correctly mentioned as an example of a field which uses this logical construct I feel there should also be an example of this and that example should be of Homo Sapiens Sapiens where the first instance of "sapiens" in the name refers to the species and the second to the subspecies of the animal in question. Of course if anyone knows of Ontology or Taxonomy terms with a similar meaning links to those would be very good too. Wiki-BT (talk) 02:20, 29 March 2009 (UTC)

This is an old merge discussion now... personally I can see it being used in other contexts too, so am removing the tag from article. Lee∴V (talkcontribs)

Namespacing articles[edit]

What does it mean to nominate an article for namespacing? - Rockmandrum (talk) 19:47, 20 June 2010 (UTC)

If you're talking about Wikipedia articles, that's a question for WP:NS. -- (talk) 12:27, 6 August 2010 (UTC)

namespace vs container[edit]

What is the difference between a namespace and a container? Is a container that can be used qualified providing a namespace (e.g. struct and directory), or are they excluded from the definition.

I also think the namemangling remarks should be removed. If only since it is not clear what the exact name is (instance name or type name). Mangling uses the typename, while when qualifying the hierarchy (x.y.z) in the source the instance name is used. (talk) 16:03, 10 May 2011 (UTC)

Wikipedia namespace example[edit]

There should be an example dealing with Wikipedia's namespacing conventions. Not as a WK edition tutorial (does not belong there), but as an example more evocative to WK users than this or that programming language. Why describe, say, C++ and Java, but not Wiki ? Thierry Le Provost (talk) 10:00, 22 May 2013 (UTC)

Discussion of namespaces in C++[edit]

I made a few edits to the text of this section. The previous text did not do a good job of differentiating between the English word "using" and the C++ "using" directive. In particular, I removed the statement: "Bjarne Stroustrup, designer of C++, has said himself that using namespaces is unsafe and wished he had not included it in the language." As written, that is almost certainly inaccurate, and at the very least it is uncited.

For starters[edit]

The for starters section is fairly convoluted, and i would say the XML example shown is certainly not for starters. Would anyone object to me removing it? Gsonnenf (talk) 06:33, 24 June 2015 (UTC)


Why does the "solution via prefix" subsection, under Name Conflicts, suddenly mention Civil Engineering and Electrical Engineering, and then An Engineering College? Shouldn't it simply repeat the html table's information (Apples and Bananas) and then the furniture 'table' section (African Coffee Table) but with prefixes? Am I missing something? — Preceding unsigned comment added by Jayache80 (talkcontribs) 01:04, 12 March 2016 (UTC)

C language example[edit]

Is the C language example in the article appropriate? I thought that the primary usefulness of namespaces in programming was to allow abbreviated identifier names based on the context. The C example using structures does not accomplish this. Michael9422 (talk) 18:57, 26 August 2016 (UTC)

Computer science considerations[edit]

In this section, there is the sentence:

"Namespaces (or a similar technique, see Emulating namespaces) provide a mechanism for hiding local identifiers."

I would say, instead, that they allow abbreviations for unique, non-local or global identifiers. Michael9422 (talk) 19:00, 26 August 2016 (UTC)

Emulating namespaces?[edit]

I am skeptical of the section called "Emulating namespaces". It seems a bit like revisionist history to me. The problem of excessively long identifier names in order to avoid global name conficts is the problem that motivated the invention of namespaces, isn't it? Could we just as well say that namespaces are emulating the choice of clear, hierarchical, and unique global variable names? Which came first? Michael9422 (talk) 02:04, 27 August 2016 (UTC)


There are criticisms of namespaces that might deserve mentioning in the article, perhaps in a new section. For example, see "Why I Hate Namespaces", by Danny Kalev:

In the article, he says that adding namespaces to C++ was a mistake. Michael9422 (talk) 19:03, 26 August 2016 (UTC)

Nevermind. I was not aware that there is already a wikipedia article called ADL (argument dependent name lookup), and it covers this. Michael9422 (talk) 15:00, 28 August 2016 (UTC)