From C# 2.0 to 3.0

The new features of C# 3.0 are amazing, it makes coding so much more comfortable. Anonym variables and the LINQ extensions rock.. Some examples:

// expr is compiled as IEnumerable<Customer>
var expr =
from c in customers
where c.City == “London”
select c;

// anon is compiled as an anonymous type
var anon = new { Name = “Terry”, Age = 34 };

Also they finally implemented some sort of auto properties. It’s now possible to write a property and let the compiler create the according private fields automatically. That reduces a whole lot of code bloat..

The next days I’ll write some webparts at the job, a great chance to try out this new stuff šŸ˜‰


0 Responses to “From C# 2.0 to 3.0”

  1. Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: