Re: Using ref
- From: "Peter Duniho" <NpOeStPeAdM@xxxxxxxxxxxxxxxx>
- Date: Thu, 03 Jul 2008 12:48:06 -0700
On Thu, 03 Jul 2008 12:16:18 -0700, raylopez99 <raylopez99@xxxxxxxxx> wrote:
On Jul 3, 10:13 am, "Peter Duniho" <NpOeStPe...@xxxxxxxxxxxxxxxx>
wrote:
They are _not_ "doing EXACTLY the same thing". The C# version is passing
the address of a variable that contains a reference to an object, while
the C version is passing the address of a variable that contains the
object itself.
That's pretty slick, and you have to acknowledge that people coming
from a non-managed, non-automatic garbage collected, non-Intermediate
language background like C or C++ (classic version) might not grasp
this subtitety, PD.
I can do one better: I can acknowledge that people who _ought_ to already be familiar with the managed, garbage-collection, IL-based language of C# might also not grasp the subtlety. This thread is proof of that.
On the other hand, plenty of people (myself included) correctly comprehend how C and C++ works, and thus have no problem shifting to the syntax used in C#. After all, C was always "by value"-only, and C++ added "by reference". The parameter passing in C# works the same as the respective behaviors in C and C++. There's no adjustment to be made, as long as you understand things correctly to start with.
But what of all that? I don't have any problem with a concept requiring explanation to someone who isn't getting it. What I have a problem with is someone insisting that they understand the concept when they don't.
The fact that a concept is subtle doesn't excuse _willful_ lack of understanding.
[...]how much you wish for C to have pass by reference, and no matter how much
you wish for C#'s pass by value to be the same as C#'s pass by reference,
it simply will not be.
We can will it away, Nietzsche style. Remember, F. Nietzsche did not
believe there was one objective "TRUTH" out there, but many points of
view.
The C# specification defines the language. Inasmuch as the specification is unambiguous (and on this point, it is), there is a single truth.
Put another way: if a competent scientist publishes a paper on
evolution that is correct in terms of received wisdom, but privately
believes in Creationism, does that make his paper unacceptable?
I fail to see the relevance. We're not talking about scientific theories and religious beliefs here. We're talking about a factual concept codified by a definitive specification.
And if this poster believes that C and C#.NET pass-by-reference the
same way, which they don't according to your world view, but writes
code that works, is that unacceptable?
Is what unacceptable? The question as to whether his code works or not is not at issue here. The question is whether he should expect to state publicly his own view without dissent.
The fact is, he should not. Every time he states the incorrect view, I will feel compelled to correct his incorrect statements. In most cases, I will succumb to the compulsion.
Probably not unless you are
teaching or writing a paper on C. Sci theory. In short, William
James '19th century pragmatism' as it applies to philosophy probably
overrules whatever 'objective' objections you might have to the
posters 'wrong' world view. In short, whatever works, works,
regardless of the 'Truth' of the matter.
That's only true insofar as someone is not trying to express their own view to others. I don't give a rat's ass what someone thinks to themselves as they write their own code. If they want to hinder themselves in that or any other way, far be it from me to try to dissuade them.
But if they attempt to put forth their own incorrect view as a suggestion for others, then they've crossed the line from harmless self-gratification to harmful propagation of false information. That's where we have a responsibility to step in and correct incorrect statements.
Pete
.
- 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: Peter Duniho
- Re: Using ref
- From: raylopez99
- Using ref
- Prev by Date: Re: How to parse a string to datetime without a time
- Next by Date: Re: SQL to Linq - Left, Right and Inner Joins
- Previous by thread: Re: Using ref
- Next by thread: Re: Using ref
- Index(es):
Relevant Pages
|