Empty VS null array?

Regan Heath regan at netmail.co.nz
Mon Oct 21 04:04:12 PDT 2013


On Fri, 18 Oct 2013 21:09:35 +0100, Blake Anderton <rbanderton at gmail.com>  
wrote:

> I agree a null value and empty array are separate concepts, but from my  
> very anecdotal/non rigorous point of view I really appreciate D's  
> ability to treat them as equivalent.
>
> My day job mostly involves C# and array code almost always follows the  
> pattern if(arr == null || arr.Length == 0) ...

Interesting.  My day job is C# and I almost never do that.  I check for  
null and treat empty as any other string value.  The /only/ time I have to  
check for empty is when I have interfaced with 3rd party code which has  
decided to conflate empty and null to mean the same thing.

Regan

-- 
Using Opera's revolutionary email client: http://www.opera.com/mail/


More information about the Digitalmars-d mailing list