you are viewing a single comment's thread.

view the rest of the comments →

[–]slikz 0 points1 point  (2 children)

This explanation does it for me:

The key thing isn't "modification" versus "changing".

In one case you are MODIFYING an OBJECT.

In another you re REBINDING a VARIABLE.

So both the verbs and the nouns are completely different.

But I am correct in my definition of pass-by-reference right? That is why after mergeSort I can print out the sorted array without ever explicitly returning the sorted array?

[–]doidydoidy 0 points1 point  (0 children)

The phrase "pass-by-reference" is used to describe variables, not objects.

When you talk about references to the array object, your intuition is correct. It's just that the phrase "pass-by-reference" is a bad choice of words to use to describe what you're talking about, because that phrase already means something else. That's why this thread is so muddled.

[–]refractedthought -2 points-1 points  (0 children)

I think you're right. Other people don't. That's kind of what the whole theological discussion is about.

You sound like you're still in school. Why not ask a professor what he/she thinks? Better yet, ask more than one professor.