Monday, January 5, 2009

Hidden Features in C#

1) Using @ for variable that are keyword.

var @object = new object();
var @string = "";
var @if = IpsoFacto();

2) Aliased Generics.

using ASimpleName = Dictionary<string, Dictionary<string, List<string>>>;


Allows you to ASimpleName,instead of

Dictionary<string, Dictionary<string, List<string>>>;

Use it when you would use the same generic big long complex thing in a lot of places.