What would we do without NULL?

后端 未结 11 915
迷失自我
迷失自我 2021-02-01 05:26

I once read that having nullable types is an absolute evil. I believe it was in an article written by the very person who created them(in Ada?) I believe this is the article

11条回答
  •  失恋的感觉
    2021-02-01 05:53

    We use either

    1. Discriminators. An extra attribute or flag or indicator that says that a value is "null" and must be ignored.

    2. Domain-Specific Nulls. A specific value -- within the allowed domain -- that is interpreted as "ignore this value". For example, a social security number of 999-99-9999 could be a domain-specific null value that says the SSN is either unknown or not applicable.

提交回复
热议问题