Re: Pointer vs Reference



On Sun, 30 Sep 2007 02:14:20 +0200, Lasse Reichstein Nielsen
<lrn@xxxxxxxxxx> wrote, quoted or indirectly quoted someone who said :

I.e., the JLS identifies references and "pointers", so saying that
references are pointers is trivial and vacuous.

Here's my take on what happened. Originally Java's references were
called pointers. However, the term "pointers" had a bad rap from what
chaos happens when you allow pointer arithmetic, optional
initialialiser and manual object recycling.

So they decided to rename them "references". But old habits die hard,
and people, even those at Sun, sometimes continued to call them
"pointers". The word pointer leaked through in various places
including "NullPointerException".

Somebody might put in an RFE to purge the term pointer in all but a
few carefully controlled places, and to provide an alias for
NullPointerException, NullReferenceException, and to deprecate
NullPointerException.

see http://mindprod.com/jgloss/rfe.html
I don't want to do it. It is a little too weenie for me.

--
Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com
.



Relevant Pages

  • Re: =& when creating new object
    ... $reference point to the same memory location. ... Please read the chapter called "references are not pointers" in the ... should not consider it an address in PHP. ...
    (comp.lang.php)
  • Re: Delphi Classes/Pointers] Nil references causing problems.
    ... In the context of this group I often write "Pascal" instead of Delphi or OPL, ... references - something like C++ references, ... Almost every language allows to express things in a specific manner, ... occupation I'm tired of seeing pointers all around, and the many tests for NULL ...
    (comp.lang.pascal.delphi.misc)
  • Re: =& when creating new object
    ... & means 'a reference to the memory location where the value is stored'. ... That was probably the single most unique new concept (pointers and address-of) I had conquer when I learned C, coming from a Fortran background as I did. ... Please read the chapter called "references are not pointers" in the manual. ... But you should not consider it an address in PHP. ...
    (comp.lang.php)
  • Re: PHP5 and class inheritance question
    ... describe references in relationship to something which doesn't exist. ... knowledge of pointers as defined by another language. ... You're the one who tried to compare PHP references to something which ... get a clue jerry. ...
    (comp.lang.php)
  • Re: Deleting objects obtained from a STL library
    ... >> I want to use an STL libarary to hold a bunch of objects I create. ... >> besides using pointers rather than references for the STL library? ... The container uses the copy constructor, if no copy c_tor is provided ...
    (comp.lang.cpp)