• (disco) in reply to dkf

    it's very clear in Java: the handles to objects are always passed by value (with the resulting effect that objects are always passed by reference).

    By the definitions I'm familiar with, that isn't passing by reference, it's passing by value. PleegWat's explanation is excellent: https://what.thedailywtf.com/t/the-apple-genius/53643/18?u=na5ch

  • (disco) in reply to LB_
    LB_:
    Primitives are pass by value.Class types are pass reference by value.

    Those are very different to me.

    As mentioned, primitives and objects are different. With primitives there is no reference. With objects, there's a reference, and that's what is passed by value.

  • (disco) in reply to na5ch

    Yeah, that's exactly what I said but with the words in a different arrangement ;)

  • (disco) in reply to LB_

    OK, just making sure you weren't arguing that "pass reference by value" = "pass by reference". I've kind of lost track of who's saying what in this thread. :-p

  • (disco) in reply to na5ch
    na5ch:
    By the definitions I'm familiar with, that isn't passing by reference, it's passing by value.

    The reference is the value. Nothing you do to that parameter variable itself will change what the caller's view of what it passed in is. The referred-to object might be altered by some operations, but that's by-the-by.

    C# has other options available at the language level, making it unnecessary to use ugly things like Holder classes there. It also allows marking a value as being directly passable instead of by reference. OTOH, these are substantial increases in complexity for no real increase in expressibility (unless one cares about expressing a very particular ABI, I suppose).

  • (disco)

    The discussion here has been good and informative examples of trying to teach people about language and variable use. This is especially true of C#.

    For this I am going to pass the value of this thread along and reference the value here often.

  • (disco) in reply to flabdablet
    flabdablet:
    respectable languages like C and Perl

    Oddly enough, this page is the only one in the whole world which contains that phrase.

  • (disco) in reply to tharpa

    The only one that has been search indexed, anyway.

Leave a comment on “The Apple Genius”

Log In or post as a guest

Replying to comment #:

« Return to Article