Monday, June 4, 2007

Gearing up for .Net 3.5

Here are a few articles and web casts that should help you get started with .Net 3.5

Articles

Anson Horton wrote what I consider to be the Rosetta Stone to understanding many of the new features of Dot Net 3.5 . Horton will guide you through the various design decisions and technologies that were brought together to create a new feature known as Language Integrated Query(LINQ).

The Evolution of LINQ and its Impact on the Design of C#

My only criticism of Hortons article is the lack of explanation as to what extension methods are. However, I do commend Horton on his fantastic article. If you are still unsure of what an extension method is please read Scott Guthrie's blog post regarding extension methods before reading the remainder of Horton's article. The combination of the two articles should give you a sense of how .Net 3.5 has come together.

Extension Methods By Scott Guthrie

Web Casts

If your still thirsty for more, checkout the following web casts:

Wes Dyer's video discusses Language Integrated Query(LINQ) and Functional Programming. This is the best LINQ related web cast I have found todate.

Wes Dyer web cast

Anders Heijsberg recently put out the following web cast. During this video Anders discusses functional programming and the many new features introduced in .Net 3.5 . In case you have missed it, there is a new paradigm, functional programming. In short, functional programming allows you to describe "what you want to do". With typical imperative Object Orientated programming you describe "how to do something". With .Net 3.5 we will be able to mix these two different paradigms together. Functional programming is by no means new, however Microsoft's approach is.

Anders Hejlsberg on LINQand Functional Programming

.Net 3.5 Features

Here is a run down of the features to look forward to in .Net 3.5. All of the features listed here are core first class features. This means that you can depend on these features at every juncture.

  • Lambda Expressions
    • Similar to anonymous methods. The syntax is much cleaner.
  • Extension Methods
    • Allows you to extend any class. Extension methods basically are static methods that can be applied to any .Net custom or built-in type. (If this is unclear please check out Scott's article)
  • Automatic Properties
    • Private data member no longer have to declared for public properties. This should greatly reduce code.
  • Anonymous Types
    • Just like VB, C# has anonymous types. This feature is very important when it comes to LINQ.
  • Object and Collection Initializers
    • Instead of writing the following code:

      Car c = new Car();

      c.MaxSpeed = 200;

      c.Weight = 1500;

      c.Engine = "3.5L"

      I could write:

      Car c = new Car{MaxSpeed=200,Weight=1500,Engine="3.5L"};


      Scott Guthries refers to this as "Syntactic Sugar"

  • Language Integrated Query
    • Queries can be preformed against:
      • In-memory Objects
      • Databases
      • XML
Orcas Beta Release 1

I encourage you to download Orcas Beta 1. This will give you an opportunity to try many of the new features discussed above. Orcas can be downloaded in a variety of configurations.

Virtual Machines
Regular Install