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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Back
Top