# Why can't we merge Missing and Nothing?

**URL:** <https://discourse.julialang.org/t/why-cant-we-merge-missing-and-nothing/25793>\
**Category:** Internals & Design\
**Created:** [June 28, 2019, 10:03am UTC](https://discourse.julialang.org/t/why-cant-we-merge-missing-and-nothing/25793 "2019-06-28T10:03:59Z")\
**Posts on this page:** 1\
**Showing post:** 15

<div class="post-metadata">

**Author:** ![HFriberg-mosek](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/hfriberg-mosek/32/8376_2.png) [@HFriberg-mosek](https://discourse.julialang.org/u/HFriberg-mosek)\
**Post date:** [July 4, 2019, 5:15am UTC](https://discourse.julialang.org/t/why-cant-we-merge-missing-and-nothing/25793/15 "2019-07-04T05:15:28Z")

</div>

Let me illustrate what bothers me about having to distinguish “has a value, but it is unknown” and “has no value” in programming:

1. You may not know. If there is no information about siblings, you do not know whether to assign `NameOfSister` to `missing` (“has a value, but it is unknown”) or a `nothing` (“has no value”).

2. No standard for optional arguments because the types are loaded with meaning:  
`# Input, if you have a coupon`  
`buy(..., coupon::Union{String,Nothing}=nothing)`  
`# Input, if you know the DNA of your mom.`  
`healthanalysis(..., mom::Union{DNA,Missing}=missing) `

3. Production of `missing` types into codes that may not be programmed to handle it (kudos to @kristoffer.carlsson). Would you dare to define the generally intractable `isconvex(function)` or the generally undecidable `ishalting(callable)` as a `Union{Bool,Missing}` even though they are definitely of the “has a value, but it might be unknown” type? I never want that because the three-way-logic would hide bugs in my code.

What is more appropriate in my opinion is to distinguish _“value not available (if it exists, it is unknown)”_ and _“definitely has a value, but it is unknown”_. The former would be the standard goto type for all items in the enumeration above, whereas the second would be a specialization you opt into when needed. In practice, this is how I see `Nothing` and `Missing` already being used today.

---

_[View the full topic](https://discourse.julialang.org/t/why-cant-we-merge-missing-and-nothing/25793)._
