A short list of things I could determine from the C# 2.0 draft which was released yesterday which are not a topic of much discussions but are good to know. I've added page numbers to the items, so you can go back to the C# 2.0 draft yourself and look them up (page numbers are the actual page numbers on the page). I've skipped the features: Generics, Anonymous methods, Iterators and Partial types, because these are the obvious items discussed in the draft :)
No support for multiple similar overloads with different returnvalues (Page 18)
Sometimes you want to specify different overloads which have the same method declaration (method signature) but differ only in return type. There was speculation that support for this would be added to C# (Eiffel has it). However on Page 18, an example shows us that it will not be added:
class G1<U>
{
long F1(U u); // Invalid overload, G<int> would have two
int F1(int i); // members with the same signature
// ...
}
Support for Nullable types (Page 27)
A very nice thing that will be added to .NET is the support for Nullable types. In .NET 1.1, you can't use an int variable in a situation where you want it to be null as well. You could use SqlTypes.* but these are not serializable. LuKa has programmed Nullable types for .NET, but that requires that someone using your code includes a reference to that library. A native FCL version of Nullable types is a welcome addition.
Type inference reduces typing, increases complexity for the reader (Page 30)
Type inference is the mechanism the compiler will use to determine which constructed type to use by looking at the type of the parameters passed in. Example:
class Util
{
static Random rand = new Random();
static public T Choose<T>(T first, T second) {
return (rand.Next(2) == 0)? first: second;
}
}
will result in different types in the method when called using different types:
int i = Util.Choose(5, 213); // Calls Choose<int>
string s = Util.Choose("foo", "bar"); // Calls Choose<string>
While this saves the developer some typing, it is less readable code, IMHO, because when used with parameters, it is harder to determine by simply reading the code which constructed type the method will have.
Properties, events, indexers or operators may not be generic (Page 32)
This may be a big item for some people and I fail to see why indexers and properties aren't among the elements which can be made generic. Especially properties and Indexers are extremely important for generic collections. But perhaps I'm mistaken and I didn't read the draft correctly.
Partial types must be compiled together (Page 70)
I quote: "All parts of a partial type must be compiled together such that the parts can be merged at compile-time. Partial types specifically do not allow already compiled types to be extended.". It is understandable from a compiler's POV, it can be confusing perhaps when starting with Partial Types. Partial Types are extremely useful for code generators, and I can't wait to implement them :) The only fear I have is that Partial Types will not be part of VB.NET, so code generators which target multiple .NET languages are not helped by it in some cases. However I read somewhere that ASP.NET 2.0 uses partial types so VB.NET should support them as well.
I haven't looked deeply into iterators and anonymous methods yet, plus I'm sure I've overlooked some non-obvious gems so when you have any extra info, post them in the comments :)