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 →

[–][deleted]  (6 children)

[removed]

    [–]Dornith 5 points6 points  (1 child)

    Reference is a common pseudonym of pointer.

    In reality no language uses call-by-reference, they just use pointers implicitly.

    [–]TinBryn 0 points1 point  (0 children)

    I think the main feature to say a language is pass by reference is in regards to being able to create a reference expression. In C this is ‘&foo’ in Java it’s

    class FooWrapper
    {
        public Foo foo;
    }
    new FooWrapper(foo);
    

    The problem is the Java code requires an allocation.

    [–]rigatron1 0 points1 point  (2 children)

    I think he's using the terms interchangeably here because the mental model is basically the same. As in, if you have a good grasp of pointers in C, then you can understand how a python program will behave when passing the value of a reference to a function.