Jon Skeet said:
Any reason not to just use a property or method?
For the non copy constructor behaviour, it might be considered a bit of
syntactic sugar.
For the *existing* copy constructor behavior in C#, there is of course no
way to replace that with just a property.
But the idea is that C# allows users to create new simple value (or complex
classes) types, and easily allow them to interact with int and other. There
are some examples in the help. The examples are good code, but they arent
really good examples for showing their usefulness.
But imagine that I need a BCD class. I can make it a value type (struct)
(or a classs).
BCD xValue;
xValue = 400;
int i = 4;
xSum = xValue + i;
This all works and is much cleaner, because of the implicit conversions
that you didnt find a use for.

This is in fact a very simplistic
example, there are much more advanced and better uses, one of which I'll be
writing a paper on soon as Im presenting on it at SDA Asia in Singapore
this month.
I know Jon that your much more advanced than the majority of this group,
but dont assume just because you've not seen or needed the usefulnes of
something that it is inherently bad or unuseful. I dont use parts of the
FCL, but that doesnt make them useless.
What kind of bug are you thinking of? I can't remember the last bug I
had due to a for loop itself...
The conditions are often goofed up by developers depending on the base of
the indexer 0 or 1, and its terminator (i<50, or i<=50). Sure we all know
the proper format of the c style for, but its a very common source of bugs,
and Im even ocassionaly caught by it. While I dont mind that they have it
in C#, I much prefer my developers use while/repeats in the more advanced
permutations of the for. For the 99% of the simple cases, it would be much
better if C# had also added a simple:
for int i = 1 to 50 step 2 etc.. Maybe a C style mutation would be more
like:
for (int 1, 1, 50, 2) or something, but none the less would reduce bugs as
its harder to make "stupid" mistakes this this form, and the 1-2% cases
that fall outside this construct users could use the existing for, or a
repeat style loop.
I can't remember *ever* writing one, in fact... the predefined ones are
See above.
useful, particularly those involving TimeSpan and DateTime, but they're
very rarely useful on a user basis, IMO.
Thats not true.

If you are a user who mostly uses classes, which in fact
is the majority of users I agree. However if they are useful to the
builders of the FCL, they are very useful to builders of other class
libraries too.
I would say that any assignment to a variable which only changes *part*
of the data associated with that variable counts as a bad move, myself.
Quite possibly. It fully depends how its implemented. Imagine the BCD
example above - imagine that it might be useful to on its constructor
specify a size.
BCD xValue = new BCD(10);
xValue = 400;
int i = 4;
xSum = xValue + i;
But when I do xValue = 400, the 10 argument will be lost because of copy
constructor behavior. Sure, the answer is make it a property but then the
BCD loses its ability to work as a "simple" type. Im not saying whether or
not such a feature is good or bad - as I said it made a mess in VB, but
that was because of its poor handling of objects. But the current copy
constructor behaviour is VERY good and in no way would I ever want to see
that removed.
--
Chad Z. Hower (a.k.a. Kudzu) -
http://www.hower.org/Kudzu/
"Programming is an art form that fights back"
Develop ASP.NET applications easier and in less time:
http://www.atozed.com/IntraWeb/