Friday, January 8, 2010

Null Coalescing Assignment Operator for C#

Great post by Chris Eargle about a null coalescing assignment operator for c#.

How would you like to be able to say:

myObj ??= new MyObj();

instead of:

myObj = myObj ?? new MyObj();

Seems like a trivial "enhancement" to the language but makes sense to me.

No comments:

Post a Comment