10 ms·
If this is what you mean by "proper value types" then I think that the "value type" term is bloated. For me value types mean value semantics and what you descri
by MaXtreeM 6y ago
If this is what you mean by "proper value types" then I think that the "value type" term is bloated. For me value types mean value semantics and what you describe are mostly optimizations. I like the point of Eric Lippert, that value types is not the same as "should live on stack" as a lot of people think.
I would agree that things like
> - using without IDispose for structs without implicit boxing
and
> - generics for blittable types
would make value types more "proper" in the C# language.
- pjmlp 6y agoValue types without the optimizations I listed is what keeps people writing C++ instead of doing everything in .NET proper. Just like C and C++ offer similar optimizations to avoid writing the tons of Assembly that was so common up to the mid-90's. So yes, optimizations are definitly part of proper value types.