Peter said:
It most certainly does have to do with that. One of the biggest
benefits of having built-in property support is for what's possible
_after_ the code has been compiled. You cannot ignore the compiled
output and still expect to comprehend how properties are useful beyond
simple naming conventions.
If you think that's true, then you aren't using the same definition I'm
using.
No, you can't. If you do that, then you sacrifice a big part of what
makes properties useful.
[ SNIP ]
Educate me then. I'm not being deliberately obstreperous here; I would
genuinely like to find out what this extra is that you say .NET
properties have. I have never run across any MS or non-MS website that
says anything about whatever it is that you are talking about. And
again, I'm not trying to be a simple ass here - I genuinely don't get
what you're trying to say.
Direction to good web articles or even a book or two is fine, and they
can be as advanced as you think is necessary. I have in fact been
following everything you've said in this thread, and the closest I see
to any kind of explanation is a post of yours from about 2115 on the
25th of Feb. There you made two points: one about "more robust data
binding", and one about the help that properties provides to GUI
designers. I'm not particularly concerned about GUI designers, but
perhaps you could direct me to some material that expands on the first
point.
AHS
P.S. We may as well not argue about the definition of syntactic sugar.
What I understand to be the definition of syntactic sugar, as also
defined by Wikipedia, and as I've seen innumerable people use it, never
mentions differences in intermediate or object code.
I might also add, one might want to be careful about striking a note of
infallibility. In the same post of yours I mentioned, you say:
"Note that other naming conventions solve the question of distinguishing
a property from a field. For example, the .NET naming convention
requires properties to start with a capital letter, and field names with
a lower-case. Thus, "a.b = 5" is always setting a field, while "a.B" is
setting a property"."
In fact this is not true. An extremely common .NET convention is
specifically for public member fields and properties both to be
capitalized. More precisely, I've almost always seen properties
capitalized, and I've seen reams and reams of C# that has public member
fields capitalized, including a lot of source by authoritative writers.