Saturday, February 09, 2008

How To: “Getting Started with C# 3.0”

Here is my suggested approach on how to get started with C#3.0. This strategy is advised to be followed by those who are seasoned programmers in .NET 1.1 / 2.0, and now they want to get their hands on C#3.0. It’s quite an easy migration as far as the core language enhancements in C#3.0 are concerned. One can get a good know how as well hands on experimentation of the new features in a matter of hours.

So here go the steps on how to get started with C#3.0.

C#3.0 Language Specifications
Go through the C# 3.0 Language Specifications. It’s just a 26 page document, containing each of the new feature definition as well as the code samples. If you have been working in C# 2.0, you can go through it in a matter of 3 hours.

I don’t want to reproduce what ever is in the above document, but just to give you an idea that there are only a few additions in C# 3.0 and those are the implicitly typed local variables, extension methods, lambda expressions, object initializes, anonymous types, implicitly typed arrays, query expressions and the expression trees. These additions serve as the foundation for LINQ (Language Integrated Query) and make the code concise.

You can download the C# 3.0 Language Specifications document from here.

C#3.0 Language Enhancements Hands On Lab
There is a comprehensive hands on lab exercise outlined by Microsoft, and that’s too isn’t that long, and would only take a few hours to go through and experiment, for a seasoned programmer.

You can grab the complete script of the Hands on Lab from here.

No comments: