J
Jon Skeet [C# MVP]
ah but the discussion has been very spirited.
That's certainly true.
I think we can agree that
1. The existing literature establishes the ground rules.
Well, I don't think I'd call them "ground rules". I'd agree that the
existing literature uses the word "lightweight" in discussions of
structs with varying degrees of accuracy.
2. It's too late to change the established ground rules even without regard
to the fact that they may or may not be correct.
I don't agree with that. In the Java world, many early books
incorrectly stated that Java passed objects by reference. This caused a
great deal of confusion. Are you saying you think those books shouldn't
have been corrected, and the correct terminology used? As another
example, are you suggesting that MSDN shouldn't have been fixed to
correctly describe System.Decimal as a floating point type instead of a
fixed point type? Are you suggesting that people should go along with
the idea that ASCII has 256 values, just because lots of web pages (and
some MSDN pages) claim that it has?
If something is incorrect, it should be pointed out as being incorrect.
Pretending that something is correct just because it's widely
stated/believed is a really bad idea.
How about the whole universe going round the earth, by the way? That
was one of the "established ground rules" before it was challenged...
3. Concepts defined within the C# language should not be viewed within the
context of other languages.
Well, they can be compared with other languages, but only carefully.
4. Programmers must understand language facets in detail before using these
constructs in production code especially where these constructs may have
have performance consequences or may be used in time-sensitive applications.
I don't think performance is actually the key concern here - that's one
of the things that bothers me about simply describing structs as
"lightweight classes" - it ignores the most important part (value type
semantics) and concentrates on the efficiency part (and overgeneralises
that too).