O'Reilly logo
  • Eihab Hala thinks this is interesting:

A type should only be a struct if it represents something that is very clearly similar in nature to other things that are value types. (It should also be fairly small, because passing large types by value is expensive.) For example, in the .NET Framework class library, Complex is a struct, which is unsurprising because it’s a numeric type, and all of the built-in numeric types are value types. TimeSpan is also a value type, which makes sense because it’s effectively just a number that happens to represent a length of time. In the UI framework WPF, types used for simple geometric data such as Point...


Cover of Programming C# 5.0


الى هنا