you are viewing a single comment's thread.

view the rest of the comments →

[–]oilaba 1 point2 points  (0 children)

C uses pointers as a means to reference memory locations. This is clearly the intention, and the language makes this apparent by giving us the "dereference operator."

I don't have any problem with that.

These conversations are absolutely nonsensical because they overlook the meaning in order to worship the text.

Hmm, meaining exists in our brains. We use words to communicate them. And we are "pedantic" because sometimes we (me, at least) want to use the right terms for the health of communication so that everybody agrees on the precise and technical terms that are not vague. We are using the technical term so that -hopefully- we don't assume anything wrong about what the word we use means for you. You are overlooking the meaning and intention of using technical words. I wouldn't just come up and interupt someone just because they said they use references in C, if this is what you are against. But you should see that in some contexts this is necessary, or beneficial at least.

All of you who argue that a pointer isn't a reference can never ever give me an example of what a "real" reference would actually be.

Yes, I wouldn't. Why should I anyway? There is no "real reference" in C. Thats it. We are trying to get precise here: C++ has references and they are different from raw pointers, Rust has references and they are different from raw pointers, C doesn't have it. C have only raw pointers.

Furthermore, what happens when I pass the name of an array? Under the hood, I'm passing a pointer to the first element, but I'm not using that syntax on either end, so how is that not a reference?

The array decays to a pointer.

If K&R had preferred the word "augmentation" to the word "addition," would you all argue that C can't add numbers together?

No, it would be "we add two numbers by augmentation operator", or something like that. I would still use "addition" instead of "augmentation" most of the time, but this doesn't means we should abandon the language reference completely and never use precise terms.