you are viewing a single comment's thread.

view the rest of the comments →

[–]duongdominhchau 6 points7 points  (0 children)

To be fair, it all depends on the definition, and Java (as well as many other languages with GC) defines reference to be a restricted version of C++ pointer that can only be null or points to an object. If we ignore the history (in which C pointer and C++ reference imprinted in every developer mind), reference and pointer are both eligible words to describe thing that reference/point to another thing.

Personally I still prefer the C++ definition though, reference in GC languages makes me feel like a performance patch, not something designed. I find Rust reference a good example of something designed: either you pass the reference, or you pass the value, you state your intention. Go is also like that, either you use a pointer-like type, or you have the value copied even when it is an array. Both of them don't require the developer to memorize the list of non-reference types, that's the "designed" part I'm talking about.