Jump to content

Talk:Namespace

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia

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)[reply]

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)[reply]

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)[reply]

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))[reply]

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)[reply]

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)[reply]

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

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. 88.159.64.210 (talk) 16:03, 10 May 2011 (UTC)[reply]


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)[reply]

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)[reply]

prefixes

[edit]

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)[reply]

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)[reply]

I don't believe it's appropriate. namespaces in programming languages are distinct from objects; namespaces are a compile-time construct, while objects are a run-time construct. 13:47, 13 May 2017 (UTC) — Preceding unsigned comment added by 73.109.28.98 (talk)

OK, I removed it. Michael9422 (talk) 19:23, 26 June 2017 (UTC)[reply]

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)[reply]

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)[reply]

criticism

[edit]

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:

https://web.archive.org/web/20160709115609/http://www.informit.com/guides/content.aspx?g=cplusplus&seqNum=286

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

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)[reply]
[edit]

Hello fellow Wikipedians,

I have just modified 3 external links on Namespace. Please take a moment to review my edit. If you have any questions, or need the bot to ignore the links, or the page altogether, please visit this simple FaQ for additional information. I made the following changes:

When you have finished reviewing my changes, you may follow the instructions on the template below to fix any issues with the URLs.

This message was posted before February 2018. After February 2018, "External links modified" talk page sections are no longer generated or monitored by InternetArchiveBot. No special action is required regarding these talk page notices, other than regular verification using the archive tool instructions below. Editors have permission to delete these "External links modified" talk page sections if they want to de-clutter talk pages, but see the RfC before doing mass systematic removals. This message is updated dynamically through the template {{source check}} (last update: 5 June 2024).

  • If you have discovered URLs which were erroneously considered dead by the bot, you can report them with this tool.
  • If you found an error with any archives or the URLs themselves, you can fix them with this tool.

Cheers.—InternetArchiveBot (Report bug) 14:51, 29 April 2017 (UTC)[reply]

Citations

[edit]

Citations seem to be scarce and there is a lot of original research ("custom namespaces are extensively used by programmers, ..."). Large portions of this article shouldn't be here, and it needs a ton more citations. Maybe add WP:TONE flag? 199.58.98.69 (talk) 06:11, 18 February 2019 (UTC)[reply]

Introduction

[edit]

The introduction reads badly to me. Why does the second sentence refer specifically to Java? "In Java, a namespace ensures that all the identifiers within it must have unique names so that they can be easily identified." That seems to be getting specific too quickly. Couldn't we just say "A namespace requires that all the identifiers within it have unique names so that they can be easily identified."? Zaddikskysong (talk) 02:23, 14 July 2019 (UTC)[reply]

[edit]

If you go to the provided link, it goes to an website that asks for one to buy the domain and doesn't provide any corrobating evidence to the article or statement. Just letting people know.

Here is a capture of the linked website when it was still active: https://web.archive.org/web/20131020153832/http://tutorials.csharp-online.net/CSharp_FAQ:_What_is_a_namespace — Preceding unsigned comment added by User:MatthewTh0 (talkcontribs)

 Done --KAP03(Talk • Contributions • Email) 05:12, 9 August 2019 (UTC)[reply]

Oops, I thought it was just that spaces weren't there so I added spaces to your edit and put dead-link=yes. I'm sorry if that is bad, feel free to undo. — Preceding unsigned comment added by User:MatthewTh0 (talkcontribs)