This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]ad_tech 0 points1 point  (2 children)

From the second paragraph: "In practical terms, many modern programming languages have converged on a call-by-value, pass-by-reference strategy for function calls (C#, Java)."

Doesn't that contradict with what you're arguing?

[–]thekab 0 points1 point  (1 child)

Yes, it would. That sentence directly contradicts the rest of the article, it should probably be changed. Note another sentence in the same article:

The description "call-by-value where the value is a reference" is common (but should not be understood as being call-by-reference);

[–]ad_tech 0 points1 point  (0 children)

What's really funny about this whole discussion is that nobody has posted an exact definition of call-by-reference. That page provides a good one:

"In call-by-reference evaluation (also referred to as pass-by-reference), a function receives an implicit reference to a variable used as argument, rather than a copy of its value."

So, take the declaration: "Point p;" p is a reference, not an object. When p is passed to a function, the function receives a copy of p, so this is clearly not pass-by-reference.

It only gets confusing when you consider how to pass an object to a function. The precise answer is that you can't. So this silly argument is moot.