# Diff missing vs nothing

**URL:** <https://discourse.julialang.org/t/diff-missing-vs-nothing/35806>\
**Category:** General Usage\
**Created:** [March 10, 2020, 5:56pm UTC](https://discourse.julialang.org/t/diff-missing-vs-nothing/35806 "2020-03-10T17:56:08Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![kimran](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kimran/32/7782_2.png) [@kimran](https://discourse.julialang.org/u/kimran)\
**Post date:** [March 10, 2020, 5:56pm UTC](https://discourse.julialang.org/t/diff-missing-vs-nothing/35806/1 "2020-03-10T17:56:08Z")

</div>

What is the difference and the idea behind the difference?

I saw somewhere that `missing` is for data and `nothing` for everything else.

But why do we not just use either `missing` xor `nothing` for all null/missing values

---

<div class="post-metadata">

**Author:** ![simeonschaub](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/simeonschaub/32/216566_2.png) [@simeonschaub](https://discourse.julialang.org/u/simeonschaub)\
**Post date:** [March 10, 2020, 6:22pm UTC](https://discourse.julialang.org/t/diff-missing-vs-nothing/35806/2 "2020-03-10T18:22:45Z")

</div>

It is explained in the FAQ in the official docs here:  
[https://docs.julialang.org/en/v1/manual/faq/#Nothingness-and-missing-values-1](https://docs.julialang.org/en/v1/manual/faq/#Nothingness-and-missing-values-1)

It basically comes down to the following: `missing` is basically for representing missing values in a data set. It therefore just propagates through most basic arithmetic functions and uses three-value logic in boolean contexts. `nothing` has more of a syntactic role, so it is used as return value for example for functions like`print`, where returning anything else wouldn’t make any sense. Iterators use it as well to signify there aren’t any items left to iterate over. Pretty much any other function will error if passed nothing, so you know right away, where nothing was returned, as it is usually not supposed to just propagate.
