----------------------------------
wish: static interfaces for use in the context of generic type constraints
static interface ISummable<T>
{
T operator +(T arg1, T arg2);
}
which then lets you write
static T Sum<T>(IEnumerabel<T> source) where T : ISummable<T> { }
----------------------------------gripe: array covariance (which the designers copied from java even though people knew it was a mistake even when java had it):
//the following is still valid and will happily compile and run
string[] strings = new string[5];
object[] objects = strings;
objects[0] = new Exception();
----------------------------------wish: non-nullable references (ackowledges that it is a hard problem but "it would be nice to have")
----------------------------------
wish/gripe: c# enums are labels for numbers which let you write things like:
enum Color {red = 0, green = 1, blue =2}
Color c = (Color) 5;
Color c2 = 0.0;
he wants to see java-like enums which enforce the idea that you're dealing with a restricted set of values.----------------------------------
wish: Read-only keyword for auto-properties
.net 3 made it easy to tack mutable properties onto your class
string Name{get;set;}
Jon wants to see: string Name{ readonly get; }
which tells the world that not only is Name immutable externally to your class, but internally as well. string Name { get; private set; }
does not get you there, since the property is still fully mutable within your class.----------------------------------
wish: sealing/unsealing classes
this was his self-proclaimed controversial point
he either wants to see classes sealed by default and then unsealed with an explicit 'unsealed' keyword or he wants the default class template in Visual Studio to demand that the programmer pick one or the other
----------------------------------
gripe: object is bloated, cut Equals() and HashCode()
writing equals in a type hierarchy is a pain and gets messy when you drill down into the derived types
let authors "opt in" to equality
want a map of <T>? or a dictionary of <T>? you have to provide an equality comparer
"there doesn't have to be one canonical idea of equality for a type so why is it in object"?