Thursday, April 22, 2010

A Few New Things In .Net 4 & C# 4


Basically a better option than using object[] in some scenarios (Tuple elements are typed).

Useful For

· Creating arbitrarily sized sets of individually typed elements (can be longer than 8, just tricky).

· Creating functions with multiple return values.

· Create simple structs/classes on the fly.

· Pass multiple parameters in a single one (e.g. Thread.Start(Object)).


Used to make plug-ins.

(Also note the similar preexisting alternative, MAF, in the System.Addin namespace).


This is the guy responsible for all of the dynamic keyword magic. You can subclass this to create your own dynamic objects (e.g. all properties on your object can dynamically be mapped to xml elements).


This is the guy that you can add members to dynamically.

Named & Optional Parameters

Yay, C# has optional parameters now!


Getting fancy with threading syntax.


Super threading (thread pool enhancements).

Exception Handling Changes

Boring… but probably very important to know.


  1. Hi, Great.. Tutorial is just awesome..It is really helpful for a newbie like me.. I am a regular follower of your blog. Really very informative post you shared here. Kindly keep blogging. If anyone wants to become a .Net developer learn from Dot Net Training in Chennai. or learn thru Dot Net Training in Chennai. Nowadays Dot Net has tons of job opportunities on various vertical industry.
    or Javascript Training in Chennai. Nowadays JavaScript has tons of job opportunities on various vertical industry.