structs vs classes

  • Thread starter Thread starter news.microsoft.com
  • Start date Start date
N

news.microsoft.com

Why not just have an attribute that specifies how the type is to be treated
instead of a different keyword?
 
The difference between a reference type and value type is pretty fundamental
and with big implications for your code, I think that deserves a different
keyword, if anything does. Attributes shouldn't change something so
fundamental about your class, they should annotate or describe some
meta-property of it. As well, it's more convinient when speaking with
others to simply say 'class' or 'struct' rather than saying 'class with
IsValueType attribute applied' or worse, forgetting to say that and having
others misunderstand your questions.

Richard
 
Back
Top