4 ms·
A pointer in C is a reference (see ISO 9899:1999 § 6.2.5) under siege by nasal demons (see § 6.3.2.3). The implementation isn't really required to do many of th
by nknighthb 12y ago
A pointer in C is a reference (see ISO 9899:1999 § 6.2.5) under siege by nasal demons (see § 6.3.2.3). The implementation isn't really required to do many of the things people assume it is.
(It's ironic, by the way, that in seeking to be more pedantic, you reference stacks. Stacks are not part of C.)
- jjnoakes 12y agoA C pointer is not a reference in the way we are using the word reference in this discussion (as in pass-by-reference, as in an alias for another value without applying any operators). Sure, the C standard uses the English word "reference", as in "refers to" and "referred to", but letting that confuse you without understanding the meaning of the word in context is what lead to this Java mess in the first place. Don't bring C into it too.
- nknighthb 12y agoI'm not confused at all, thank you. I'm of the long-standing and well-informed opinion that "pass-by-reference" and "pass-by-value" are worthless terms that need to die, and that this entire conversation is an exercise in useless academic pedantry.
- jjnoakes 12y agoBased on your previous reply, you are indeed confused. Reference is a long-established term, and using it to refer to C pointers is typically considered incorrect. In addition, pass-by-reference and pass-by-value are very useful terms for anyone interested in accurately speaking about and understanding what will happen when they run the program they write. There are people who consider accuracy and understanding to be pedantry. More often than not, in my experience, they are a larger source of bugs than those who strive to truly understand how their tools work.
- nknighthb 12y ago> Reference is a long-established term, and using it to refer to C pointers is typically considered incorrect. I am not confused, I disagree. > In addition, pass-by-reference and pass-by-value are very useful terms for anyone interested in accurately speaking about and understanding what will happen when they run the program they write. The terms would be useful if people agreed on their meaning (they do not) and if languages actually followed one way or the other consistently (they do not). That is the very reason this thread exists. If you wish to accurately speak about what will happen, then speak about it. Describe what actually happens, instead of spending your time arguing about which round hole the square peg fits in better. > There are people who consider accuracy and understanding to be pedantry. In practice, pass-by-value and pass-by-reference provide neither accuracy nor understanding. Stop using them, and these arguments instantly vanish. > More often than not, in my experience, they are a larger source of bugs than those who strive to truly understand how their tools work. That I strive to truly understand how my tools work is the very reason I reject these terms as worthless.
- jjnoakes 12y ago> The terms would be useful if people agreed on their meaning (they do not) Most people agree on the meaning (read the JSL - it says Java is pass-by-value. Read Wikipedia too. Or really any other real reference that isn't some confused people in a forum.) > If you wish to accurately speak about what will happen, then speak about it That's what the article does. That's what the JSL does. People in these forums who still don't get it need something more. That's what I'm giving them.
- nknighthb 12y ago> Most people agree on the meaning (read the JSL - it says Java is pass-by-value. I assume you mean the JLS, in which case it -- very wisely -- does not use the term "pass-by-value" (or any similar term I've seen) to label its semantics. It simply describes its semantics. > Read Wikipedia too. Or really any other real reference that isn't some confused people in a forum.) So is it "most people" or a reference that, if anything, supports my point (JLS), an un-encyclopedia, and unspecified "real references" that aren't from people you enjoy insulting? > That's what the article does. That's one thing the article does, yes. Why is it you think you need to point that out? > People in these forums who still don't get it need something more. That's what I'm giving them. I agree you are giving people in this forum "something more". I suspect we disagree as to what that "something" is.
- rifung 12y agoAh good point about the stacks. However, I think the point still stands.. an argument being a pointer just defines its type, while an argument being a reference does not define its type, but that it's an alias to another variable. Again, I think the issue is with terminology as someone else pointed out. Certainly a C pointer can be considered a reference when using the normal English definition of a reference, but "pass by reference" has a specific meaning, and in C you can't "pass by reference"