Talk:Reference (computer science)
From Wikipedia, the free encyclopedia
Contents |
[edit] Archived discussions
[edit] New revision
I moved back stuff like pointer and smart pointer. I believe that the article then can be devoted to mention more about the basic idea--a reference as an object refering to another object. I hope the new organization or the organization as used to be works better. Let me know if you have some thought. -- Taku 01:31, Nov 11, 2003 (UTC)
[edit] Internal/external storage
While this topic has close ties with references, in that references are the device that enables external storage, it seems like it shouldn't merit taking up such a large proportion of the article. Then again, where else could it go? I'm not sure.
Derrick Coetzee 00:52, 10 Jan 2004 (UTC)
[edit] Address analogy
Personally I found the reference quite good.My girlfriend even read and understood it and since most programmers know what a reference is the analogy is directed quite effectively to the people most likely to visit the entry...new programmers and non-technical staff. Tim Garnett 11:46, August 1, 2006
I have a problem with this section. I think it is a little too lengthy and looks like a tutorial, which is unsuitable for an encyclopedia. I think saying like a memory address and other means provide indirect access to objects should suffice to explain what references are. It may not be enough for some, but that has to be the limitation of a general encyclopedia. This is the same case that we don't expect readers to know how to do real analysis by reading articles in wikipedia. Any idea? -- Taku 04:46, August 6, 2005 (UTC)
- Yeah, too lengthy might be the case certainly. The analogy may be overextended. I'll try to strip it down to a few main points. I just wanted to add something to get across the main ideas behind a reference for people new to programming, and how it relates to familiar real-world ideas. Perhaps more examples would serve better than a more extensive example. Deco 08:47, 6 August 2005 (UTC)
- I've parred it down somewhat, so that it's at least on par with the other sections. This section could be moved to a less prominent place in the article, if that would help - I placed it at the beginning since it seems like a newbie would start there. Deco 09:08, 6 August 2005 (UTC)
-
- Excuse me, but I wrote the original Pointer Analogy before it moved to this location.I wanted to add on some of the points raised esp. with regard to newbies :
- Mapping the Telephone No. to Address, as both need to be stored in paper/variable or memory/register respectively.
- Mapping the * operator to the act of Dialling a phone no.
- Mapping the levels of indirection by using pointer to pointer with the indirect phoning i.e I phone someone who phones someone till I actually connect to the person I want. I observe that the singly linked list example is given. Giving the pointer to pointer example as above would be helpful I feel ( ***ptr is like a point-to-point connection )
- Keep the explanation more visual oriented to make it more intuitive (learning styles and all).
- My original intention was to supply a small image instead of the lengthy explanation. I'd be glad to rewrite/redraw the whole topic with your inputs. Could you give some pointers (pun intended) on this topic. Finally, please overlook formatting errors. I'm still catching up on that. -- Guruduttmallapur 08:57, 21 February 2006 (UTC)
- Excuse me, but I wrote the original Pointer Analogy before it moved to this location.I wanted to add on some of the points raised esp. with regard to newbies :
[edit] Confusing statements
[edit] Pointers of pointers
In the section on language support, the following statement is made in regards to Java, C#, and Visual Basic:
- In those managed languages, the references are actually pointers of pointers of the referred data.
This statement is mangled at best, and I believe not just confusing, but also incorrect (although since I can't be sure what it is trying to say, correctness is difficult to ascertain.) Does pointers of pointers mean pointers to pointers (handles)? If so, this isn't correct, at least not for Java. The language does not specify the mechanism used for managing memory, but certainly the vast majority of JVMs don't use handles.
In fact, I'm not sure that you can group these three languages together in regards to their use of references. -- Doug Bell (talk/contrib) 09:57, 16 January 2006 (UTC)
- I would rearrange this by adding a discussion of handles and mentioning that some implementations of some languages use them. Deco 18:18, 16 January 2006 (UTC)
[edit] Two-step pointing
The sentence following the pointers of pointers sentence above is:
- In C/C++, the reference concept of managed languages means two-step pointing.
It seems that the author is attempting to talk about indirection through handles, but I'm not familiar with the terminology two-step pointing. Since I'm pretty sure I'm well above average in familiarity with this subject, this either needs rewording or some explaination.
Also, the reference concept of managed languages might be clearer as the concept of references in managed languages, but again I'm not even sure that's the meaning the author intended.
The whole language support section seems a bit rough. -- Doug Bell (talk/contrib) 12:28, 16 January 2006 (UTC)
- Agreed, I don't like how this is worded. It's fine to describe specific behaviour of Microsoft's implementation of .NET, but we should word it as such and in particular not attempt to view C/C++ which long predated .NET from the perspective of .NET. Deco 18:17, 16 January 2006 (UTC)
[edit] Mid-step pointers
Continuing the string of obscure references (pun not intended), the sentence following the two-step pointing sentence above is:
- The Garbage Collector is the sole actor that can directly access the mid-step pointers, which cause the opacity.
The terminology mid-step pointer is apparently referring to the hidden opaque pointer in a handle. The form in which this term is used requires the term to stand on its own, but I can find no other reference to mid-step pointer.
- I concur that this is confusing. Deco 00:18, 17 January 2006 (UTC)
- Actually after reading opaque pointer this seems to have nothing to do with, well, what I would normally think of as opaque pointers. It seems to be describing some kind of data hiding technique for classes. Deco 01:20, 17 January 2006 (UTC)
- I agree that the description of opaque pointer does not match your description of opaque (below) as it applies to references. Opaque as discussed in opaque pointer is referring to the opacity of the referenced object, whereas opaque as applied to "reference" in the article is referring to the opacity of the reference value. Nevertheless, the term "opaque" refers to information hiding in both cases. Simply replace opaque pointer with pointer in my original statement to correct it. I think this discrepency in the usage of "opaque" just further illustrates the point that the meaning of opaque as used in the article needs to be defined. -- Doug Bell (talk/contrib) 19:39, 17 January 2006 (UTC)
- Sorry, I know what you meant. I agree that clarification and/or rewording is needed. Deco 21:23, 17 January 2006 (UTC)
- I agree that the description of opaque pointer does not match your description of opaque (below) as it applies to references. Opaque as discussed in opaque pointer is referring to the opacity of the referenced object, whereas opaque as applied to "reference" in the article is referring to the opacity of the reference value. Nevertheless, the term "opaque" refers to information hiding in both cases. Simply replace opaque pointer with pointer in my original statement to correct it. I think this discrepency in the usage of "opaque" just further illustrates the point that the meaning of opaque as used in the article needs to be defined. -- Doug Bell (talk/contrib) 19:39, 17 January 2006 (UTC)
- Actually after reading opaque pointer this seems to have nothing to do with, well, what I would normally think of as opaque pointers. It seems to be describing some kind of data hiding technique for classes. Deco 01:20, 17 January 2006 (UTC)
[edit] Opaque and much more opaque
The article uses the term opaque in three places—once discussing smart pointers as opaque data structures, once discussing opaque references in Lisp and, finally once discussing much more opaque references in Java, C# and Visual Basic. There needs to be some definition of opaque here, particularly what it means to be much more opaque. (Note that I added a Wikilink to opaque pointer at the first reference, but this still doesn't make the use of the term clear in this article.)
I would have attempted to fix some of this up, but a) it wasn't clear to me what the author of those passages was trying to say, and b) because for a small article, this article has a long history of being editted. Discussion welcome. -- Doug Bell (talk/contrib) 09:57, 16 January 2006 (UTC)
- To say that a reference is opaque is to say that the number of possible operations on it, particularly dangerous operations, is restricted. The vague phrase much more opaque simply means many less such operations are possible. I guess it does need to be fixed up. Deco 10:04, 16 January 2006 (UTC)
[edit] Pointers: a little historical perspective
I have removed "The C programming language introduced the pointer ..." Pointers in programming languages are at least as old as ALGOL. --75.15.154.154 05:59, 4 July 2007 (UTC)