Re: Using ref
- From: "Peter Duniho" <NpOeStPeAdM@xxxxxxxxxxxxxxxx>
- Date: Thu, 03 Jul 2008 14:51:21 -0700
On Thu, 03 Jul 2008 14:29:06 -0700, Hilton <nospam@xxxxxxxxxx> wrote:
2. The C# code is "pass by reference" even though exactly the same as its C
counterpart, just a different syntax, or
It's not "exactly the same". There are important differences between the
two that you are ignoring.
They both pass an address, they both store 20 to the memory pointed to by
that address. What important differences am I ignoring?
Well, for one, how the parameter can be used in the called method. As Jon points out, when it's passed by value, the method can then change that value locally. When it's passed by reference, the method cannot change the reference; it can only change the thing that is referenced.
[...]It is a critically important description of how the _language_ works.
Just because you can get the compiled result to accomplish the same thing,
that doesn't mean that the _language_ concepts are the same.
They don't simply accomplish the same thing, they are doing the same thing.
No, they are not. Again, you are arbitrarily ignoring important differences.
Does the fact that you keep going back to the language (and its syntax) mean
that you agree with me that this is all about syntax? Probably not. :)
I don't even see why that's important. In truth, there's a real semantic difference here. But even if it were just about syntax, does that justify you insisting on refusing to accept the standard definitions used by every well-informed, well-educated programmer?
Again, two pieces of code doing the same thing yet one is pass-by-value, the
other is pass-by-reference? (as you confirmed)
The code you posted accomplishes the same thing. That doesn't mean that the two situations are exactly the same.
If we're talking about how it 'looks' (i.e. syntax), then I agree with you
and Jon (as I stated before).
We're not. There are fundamental differences in the way the parameters are used when you have a language that actually supports passing "by reference", as compared to a language that does not.
That said, I'm done trying to help you understand. Every time you think you've come up with an example that illustrates why things are the same, we point out why the example is wrong. You either ignore those points altogether (and why not? why bother to listen to any fact that conflicts with your own view?), or you come up with some new example that is similarly flawed (repeating the cycle).
You obviously aren't interested in learning something new. You reject anything that confronts your own pre-established beliefs, and frankly, I find religious debates pointless.
At least for the time being, this thread has sufficient content to avoid any naïve reader thinking that you actually know what you're talking about, and that's good enough for me. As I said, I don't really care what _you_ believe...I just don't want anyone else thinking you're right. I'm sure that goal has been accomplished.
Pete
.
- Follow-Ups:
- Re: Using ref
- From: Hilton
- Re: Using ref
- References:
- Using ref
- From: Arjen
- Re: Using ref
- From: Steve Harclerode
- Re: Using ref
- From: Jon Skeet [C# MVP]
- Re: Using ref
- From: Steve Harclerode
- Re: Using ref
- From: Jon Skeet [C# MVP]
- Re: Using ref
- From: Hilton
- Re: Using ref
- From: Peter Duniho
- Re: Using ref
- From: Hilton
- Re: Using ref
- From: Jon Skeet [C# MVP]
- Re: Using ref
- From: Hilton
- Re: Using ref
- From: Peter Duniho
- Re: Using ref
- From: Hilton
- Using ref
- Prev by Date: Re: Using ref
- Next by Date: Re: How to parse a string to datetime without a time
- Previous by thread: Re: Using ref
- Next by thread: Re: Using ref
- Index(es):
Relevant Pages
|