Tech Off Post

Single Post Permalink

View Thread: Ideas for C# 5.0
  • User profile image
    Frank Hileman

    I would like to see features to make it easier to create data types with value semantics. This includes both classes (reference types) and structs. Currently there is a lot of unnecessary work between Equals, IEquatable, IClonable, GetHashCode, operator==, etc, with most of the work simple stuff that could be automated. For example, by default, you probably want equality and assignment to be defined as equality and assignment of fields, so there should be a way to get that automatically, and declaratively handle exceptions via attributes.


    Switching from a class to a struct, or vice versa, is painful, for no reason.


    I should not have to choose between class or struct in order to be able to choose between heap or stack allocation. Heap or stack allocation should be a decision of the user of a data type, not the implementation of the data type. That is a more extreme and probably not possible without breaking c#, because we need syntax to indicate what is a reference, and what is a value, as in C++.


    We need the notion of const-ness and const-correctness that can carry through, so we know what is immutable at a deep level. Basically, we need a more mathematically oriented language.


    I would like to see a JIT compiler that can perform as well as Java's hot-spot compiler on high performance computing applications.