Les nouveautés de C# 4

Par Sébastien Carriere 3. novembre 2008 05:56

La semaine dernière, durant le PDC, Microsoft a dévoilé le futur du language C# 4 (et VB 10).

Au programme :

  • Dynamic lookup :
    imageDynamic lookup allows you to write method, operator and indexer calls, property and field accesses, and even object invocations which bypass the C# static type checking and instead gets resolved at runtime.
  • Named and optional parameters :
    image Parameters in C# can now be specified as optional by providing a default value for them in a member declaration. When the member is invoked, optional arguments can be omitted. Furthermore, any argument can be passed by parameter name instead of position.
  • COM specific interop features :
    Dynamic lookup as well as named and optional parameters both help making programming against COM less painful than today. On top of that, however, we are adding a number of other small features that further improve the interop experience.
  • Variance :
    It used to be that an IEnumerable<string> wasn’t an IEnumerable<object>. Now it is – C# embraces type safe “co-and contravariance” and common BCL types are updated to take advantage of that.

Vous trouverez des exemples sur la code gallery :

 image

Et un document décrivant les évolutions :

Soyez le premier à noter ce billet

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

Commentaires

Powered by BlogEngine.NET 1.4.5.0
Theme by Mads Kristensen