Hacker News new | past | comments | ask | show | jobs | submit login

A pointer is a particular kind of reference (a value type that enables indirection), and C++ references are another (not very different) kind. A reference in C++ amounts to an immutable pointer.

I think you're beginning to walk that line where people start getting confused -- "I thought you said they were the same thing. Now you're saying they amount to some modified version of what you said?"

Also, I didn't swap analogies: I traded analogy for metaphor. (A reference in a computer program is a conceptual reference in the real world.)

I'm no grammar buff, but that seems to be walking a fine line. From my most recent CS SAT test:

reference::computer as conceptual reference::real world

In any case, many would argue that metaphor is equally dangerous. Djikstra has ranted on this very topic, saying it creates dangerous visualizations.

My point is that there is way to teach the concept relying on neither analogy nor metaphor, but a more basic concept of how data is stored. I think you'll find different students will react favorably to different techniques.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: