Joseph Guadagno (jguadagno@sevdnug.org) Founder Southeast Valley .NET User Group Twitter: twitter.com/jguadagno
Dynamic lookup Named and optional parameters COM  specific interop features Variance Potential features
The dynamic type Runtime lookup Dynamic objects Plain objects COM objects
 
No syntax for class creation Cannot find extension methods Anonymous functions (ie Lamda expressions) cannot appear as arguments.
Named parameters Optional parameters Overload resolution
public   void  PrintMe( string  text, int  copies, bool  collate); PrintMe(text: “ Hello World ”,  collate:  true,  copies: 1 );
public   void  PrintMe( string  text, int  copies = 1, bool  collate =  true ); PrintMe(“ Hello World ” );
A signature is  applicable  if all its parameters are either optional or have exactly one corresponding argument (by name or position) in the call which is convertible to the parameter type. Betterness rules on conversions are only applied for arguments that are explicitly given – omitted optional arguments are ignored for betterness purposes. If two signatures are equally good, one that does not omit optional parameters is preferred.
PrintMe(“ Hello World ” ); public   void  PrintMe( string  text,  int  copies = 1); public   void  PrintMe( string  text); public   void  PrintMe( object  text);
 
Dynamic import Compiling without PIAs Omitting ref
 
Some COM interfaces are not yet available Indexed properties Default properties NOTE: these will only be used for dynamically typed objects.  C# static objects will not support them.
Supported for interface and delegate types “ Statically checked definition-site variance” Value types are always invariant IEnumerable<int>  is not  IEnumerable<object> Similar to existing rules for arrays ref and out parameters need invariant type
 
Source code Source code Source File Source code Source code .NET Assembly Meta-programming Read-Eval-Print Loop Language Object Model DSL Embedding Compiler Compiler Class Field public Foo private string X
 
Visual Studio 2010 and .NET 4.0 Training http://cli.gs/VS2010training   The Future of C#, Anders Hejlsberg http://cli.gs/FutureOfC   LINQ Farm: Covariance and Contravariance in C# 4.0 http://cli.gs/LinqFarm
Joseph Guadagno (jguadagno@sevdnug.org) Founder Southeast Valley .NET User Group

What To Expect With C

  • 1.
    Joseph Guadagno (jguadagno@sevdnug.org)Founder Southeast Valley .NET User Group Twitter: twitter.com/jguadagno
  • 2.
    Dynamic lookup Namedand optional parameters COM specific interop features Variance Potential features
  • 3.
    The dynamic typeRuntime lookup Dynamic objects Plain objects COM objects
  • 4.
  • 5.
    No syntax forclass creation Cannot find extension methods Anonymous functions (ie Lamda expressions) cannot appear as arguments.
  • 6.
    Named parameters Optionalparameters Overload resolution
  • 7.
    public void PrintMe( string text, int copies, bool collate); PrintMe(text: “ Hello World ”, collate: true, copies: 1 );
  • 8.
    public void PrintMe( string text, int copies = 1, bool collate = true ); PrintMe(“ Hello World ” );
  • 9.
    A signature is applicable if all its parameters are either optional or have exactly one corresponding argument (by name or position) in the call which is convertible to the parameter type. Betterness rules on conversions are only applied for arguments that are explicitly given – omitted optional arguments are ignored for betterness purposes. If two signatures are equally good, one that does not omit optional parameters is preferred.
  • 10.
    PrintMe(“ Hello World” ); public void PrintMe( string text, int copies = 1); public void PrintMe( string text); public void PrintMe( object text);
  • 11.
  • 12.
    Dynamic import Compilingwithout PIAs Omitting ref
  • 13.
  • 14.
    Some COM interfacesare not yet available Indexed properties Default properties NOTE: these will only be used for dynamically typed objects. C# static objects will not support them.
  • 15.
    Supported for interfaceand delegate types “ Statically checked definition-site variance” Value types are always invariant IEnumerable<int> is not IEnumerable<object> Similar to existing rules for arrays ref and out parameters need invariant type
  • 16.
  • 17.
    Source code Sourcecode Source File Source code Source code .NET Assembly Meta-programming Read-Eval-Print Loop Language Object Model DSL Embedding Compiler Compiler Class Field public Foo private string X
  • 18.
  • 19.
    Visual Studio 2010and .NET 4.0 Training http://cli.gs/VS2010training The Future of C#, Anders Hejlsberg http://cli.gs/FutureOfC LINQ Farm: Covariance and Contravariance in C# 4.0 http://cli.gs/LinqFarm
  • 20.
    Joseph Guadagno (jguadagno@sevdnug.org)Founder Southeast Valley .NET User Group

Editor's Notes

  • #2 What to expect in C# 4.0 06/06/09 23:48 Joseph Guadagno: Southeast Valley .NET User Group