Friday, August 29, 2008

DID U NO?!?!!111

So maybe I'm slow, but it just dawned on me that:
 SomeClass class = new SomeClass() { SomeProperty = "" };
Is the same as:
 SomeClass class = new SomeClass { SomeProperty = "" };
What?? Look closely. The "new SomeClass" no longer needs the () if you are using 3.0's property initializers. Not ground breaking, but interesting.

1 comment:

Anonymous said...

Try using ReSharper 4, which will auto-suggest that and more.