null == "" is true?

Ola Fosheim Grøstad ola.fosheim.grostad at gmail.com
Tue Jul 19 11:20:30 UTC 2022


On Tuesday, 19 July 2022 at 10:29:40 UTC, Antonio wrote:
> NULL is not the same that UNDEFINED
>
> The distintion is really important:  NULL is a valid value 
> (i.e.: The person phonenumber is NULL in database)... Of 
> course, you can represent this concept natively in you language 
> (Nullable, Optional, Maybe ...) but it is not the same that 
> UNDEFINED... because UNDFINED says "This property has not been 
> assigned to DTO... do not take it into account".

IIRC someone wrote a master thesis about the different roles for 
null values in databases and came up with many different null 
situations (was it five?).

E.g. for floating point you have two different types of 
not-a-number, one for representing a conversion 
failure/corruption of a datafield and another one for 
representing a computational result that cannot be represented. 
If we consider zero to be "empty" then floating point has four 
different "empty" values (+0, -0, qNaN, sNaN).




More information about the Digitalmars-d-learn mailing list