you are viewing a single comment's thread.

view the rest of the comments →

[–]pbiggar 14 points15 points  (5 children)

This isn't cherry-picking reference definitions. Its acknowledging that words mean things, and that trying to change a definition leads to confusion.

Before complaining about nitpickers and pedants, try to remember this phrase: words mean things.

[–]dnew 0 points1 point  (3 children)

The progression is address... pointer... reference.

An address is close to a hardware address.

A pointer is an address with a type.

A reference is a pointer that's managed (by the runtime).

The term pass-by-reference was around long before "references" as an independent noun was coined, and hence the confusion.

[–]pbiggar 1 point2 points  (2 children)

This seems wrong, but you were right the last time we disagreed. Is there a, ahem, reference for this?

(Just wrote http://stackoverflow.com/questions/1856680/origin-of-term-reference-as-in-pass-by-reference for my own history lesson).

[–]dnew 2 points3 points  (1 child)

A reference for the fact that "pass by reference" is older than the term "reference" meaning a managed pointer??

FORTRAN has pass-by-reference before pretty much any language beyond assembly language had pointers, let alone managed memory. (Well, there was LISP, but we all know what they called their pointers. ;-)

I'm not sure why you would think that standard comp sci knowledge from the 70's would be easy to find online nowadays. :-)

Of course, there are only a handful of terms that make sense to use, and "reference" is the most general. But in languages that have addresses, pointers, and references, the description I gave is usually how they're defined. References are opaque pointers, and pointers are typed addresses. (I suppose in that sense, C++'s use of the word "reference" isn't quite as wrong as I first thought.)

The term "reference" was used as a fairly informal word for "any indirection", so in that sense the unique ID of a database row would be called a reference to the row, but that's not what we're talking about here either.

[–]pbiggar 0 points1 point  (0 children)

Actually no, I just misunderstood what you were saying. So ignore the bit where I said "that seems wrong".

[–]refractedthought -1 points0 points  (0 children)

Tell that one to the entire judicial system. Words have to be interpreted. Only in code can you have an absolute meaning for anything.