Re: Book recomendation?
yes, but then folk who read that book without the benefit of this
explanation now take up the mantra that objects are passed by reference
which isn't correct. i agree a primer shouldn't go this deep but as a matter
of nothing else but familiarity, the facts should be noted to prevent the
loss of souls.
"Jesse Liberty" <jliberty@liber tyassociates.co m> wrote in message
news:O1N9c3qjDH A.2416@TK2MSFTN GP10.phx.gbl...[color=blue]
> I won't argue the point with you (it becomes a matter of religion) but
> depending on the audience, I often say that "objects are passed by
> reference."
>
> Yes, everything in C# is passed by value, and yes a copy of a reference to
> the unnamed object in memory is passed, but that creates the semantics of
> pass by reference and the effect is (nearly all the time) identical. The
> distinction should be covered in a note, and then forgotten, as far as I'm
> concerned.
>
> Similarly, if I declare
>
> Dog fido = new Dog("fido");
>
> I will often refer to fido as a Dog, or as a Dog object or even as an
> instance of a Dog, none of which is technically correct, because of course
> fido is just a reference to an (unnamed) Dog object on the heap.
>
> It is important in a primer to be correct, but it is also important to be
> clear, and pointless legalistic distinctions often just get in the way.
>
> Guess you'll hate my books <smile>.
>
> -j
>
> --
> Jesse Liberty, President
> Liberty Associates, Inc.
> http://www.LibertyAssociates.com
>[color=green]
> > Personally, I think of a few bits that I know about but which are often
> > misrepresented, and have a look for them. For instance, the first thing
> > I do is check whether or not the author claims that "objects are passed
> > by reference". If so, that's one strike.[/color]
>
>[/color]
yes, but then folk who read that book without the benefit of this
explanation now take up the mantra that objects are passed by reference
which isn't correct. i agree a primer shouldn't go this deep but as a matter
of nothing else but familiarity, the facts should be noted to prevent the
loss of souls.
"Jesse Liberty" <jliberty@liber tyassociates.co m> wrote in message
news:O1N9c3qjDH A.2416@TK2MSFTN GP10.phx.gbl...[color=blue]
> I won't argue the point with you (it becomes a matter of religion) but
> depending on the audience, I often say that "objects are passed by
> reference."
>
> Yes, everything in C# is passed by value, and yes a copy of a reference to
> the unnamed object in memory is passed, but that creates the semantics of
> pass by reference and the effect is (nearly all the time) identical. The
> distinction should be covered in a note, and then forgotten, as far as I'm
> concerned.
>
> Similarly, if I declare
>
> Dog fido = new Dog("fido");
>
> I will often refer to fido as a Dog, or as a Dog object or even as an
> instance of a Dog, none of which is technically correct, because of course
> fido is just a reference to an (unnamed) Dog object on the heap.
>
> It is important in a primer to be correct, but it is also important to be
> clear, and pointless legalistic distinctions often just get in the way.
>
> Guess you'll hate my books <smile>.
>
> -j
>
> --
> Jesse Liberty, President
> Liberty Associates, Inc.
> http://www.LibertyAssociates.com
>[color=green]
> > Personally, I think of a few bits that I know about but which are often
> > misrepresented, and have a look for them. For instance, the first thing
> > I do is check whether or not the author claims that "objects are passed
> > by reference". If so, that's one strike.[/color]
>
>[/color]
Comment