Saturday, October 06, 2007

C# 3.0 Screencast

{

I hope I can call him a friend - I was fortunate enough to sit a class with him and then ran into him at TechEd - but Tim Rayburn has an excellent screencast overview of C# 3.0 new language features.  For 46 minutes of your time, you'll not only be up to speed, but hopefully a little excited at the future.

 The first few items have more to do with improving the syntactial approach to things we're already familiar with:

1. Automatic Properties

public string Foo{get;set;}

2. Implicitly Typed Variables

var o = new SpecificType();

3. Object Initializers

class Test{

public string Foo{get;set;}

public string Bar{get;set}

}

var p = new Test(){Foo = "shaz", Bar = "bot"};

4. Collection Initializers

List<string> myList = new List<string>(){"foo", 'bar"};

List<Test> myList2 = new List<Test>(){

new Test(){Foo="foo", Bar="bar"},

new Test(){Foo = "blam", Bar="biff"}

}

The remaining items are better explained rather than just shown - I suggest you pay closer attention to the screencast:

5.  LINQ & Anonymous Types

6. Lambda Expressions

7. Extension Methods

(This was, as Tim assumed, my favorite piece)

Although Partial Methods were noted on the list, time seemed to run out on Tim. Stay tuned; it appears he is planning to continue doing screencasts.

}

2 comments:

TRayburn said...
This comment has been removed by the author.
TRayburn said...

You most certainly can call me a friend, and I am certainly glad you enjoyed it. The partial methods portion of the talk was lost in editing due to unworkable background noise, but yes I do intend to do more of these.