Coalesce operator - usage (c#)
Ive seen an increasing number of pieces of code that use the coalesce operator in a (to me anyway) slightly odd manner, thoughts on this usage?


e.g. doing:

    string foo = null;
    void bar(){
     foo = foo??"hello";
    }

instead of 

    string foo = null;
    void bar(){
     if (foo==null)
      foo="hello";
    }


Coalesce operator - usage (c#)
===

Ive seen an increasing number of pieces of code that use the coalesce operator in a (to me anyway) slightly odd manner, thoughts on this usage?


e.g. doing:

    string foo = null;
    void bar(){
     foo = foo??"hello";
    }

instead of 

    string foo = null;
    void bar(){
     if (foo==null)
      foo="hello";
    }

