Wednesday, November 08, 2006 1:30 AM
bart
C# Automatic Properties
EnJust went to the talk of Anders Hejlsberg on C# 3.0 titled "C# 3.0: Future Directions in Language Innovation from Anders Hejlsberg". I've been playing around with C# 3.0 for a pretty long time now (somewhere shortly before PDC 05). Basically my intention was to see Anders' approach in introducing the various new features in a concise way, which might be usable in personal future presentations on the topic. Hearing the stuff from the inventor himself is always great, so if you have the chance to go Anders' sessions this week on TechEd, you can see a repeat of this session later today at 5 PM in room 125. Also worth to check out will be the session called "Explore C# 3.0 with Anders Hejlsberg" in room 112 at 1:30 PM.
What I wanted to tell you from a technical point of view is a new much requested feature that's added to C# 3.0 but isn't in the technical (LINQ) preview yet, called automatic properties. Basically it allows you to write stuff like this:
public string Bar { get; set; }
which will be translated automatically in something like this:
private string foo;
public string Bar
{
get { return foo; }
set { foo = value; }
}
Lots of powerful stuff coming in C# 3.0, check out my previous posts on the topic as well (see
C# 3.0 post category). I have some posts on
expression trees in the queue that will appear online shortly. The current posts I'm linking to a sort of a preface to the topic from a computer science perspective with a little example called DynCalc. In upcoming posts you'll see the System.Expressions way to do the same, ultimately resulting in a sample to translate an expression tree in a domain-specific querying language.
Del.icio.us |
Digg It |
Technorati |
Blinklist |
Furl |
reddit |
DotNetKicks
Filed under: C# 3.0, TechEd 2006 Europe