# What's the difference between Null, NA, #NULL, nothing, ""

**URL:** <https://discourse.julialang.org/t/whats-the-difference-between-null-na-null-nothing/6468>\
**Category:** Data\
**Created:** [October 16, 2017, 12:54pm UTC](https://discourse.julialang.org/t/whats-the-difference-between-null-na-null-nothing/6468 "2017-10-16T12:54:37Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![sylvaticus](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sylvaticus/32/203883_2.png) [@sylvaticus](https://discourse.julialang.org/u/sylvaticus)\
**Post date:** [October 16, 2017, 12:54pm UTC](https://discourse.julialang.org/t/whats-the-difference-between-null-na-null-nothing/6468/1 "2017-10-16T12:54:37Z")

</div>

I am a bit lost on the many ways to represent the “empty” concept in Julia…  
What is the difference between `Null` (from [Nulls.jl](https://github.com/JuliaData/Nulls.jl)), `NA` (From [DataFrames](https://github.com/JuliaData/DataFrames.jl)), `#NULL` from [NullableArrays](https://github.com/JuliaStats/NullableArrays.jl), `Nullable` container ([from base](https://docs.julialang.org/en/stable/manual/types/#man-nullable-types-1)), `nothing` (in base) and the empty string `""` ?

---

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [October 16, 2017, 2:26pm UTC](https://discourse.julialang.org/t/whats-the-difference-between-null-na-null-nothing/6468/2 "2017-10-16T14:26:56Z")

</div>

Things are in transition at the moment.

`Nullable{T}` can be returned by a method that may or may not return a value. This is useful for [type stable code](https://docs.julialang.org/en/latest/manual/performance-tips/#Write-%22type-stable%22-functions-1), but can be cumbersome occasionally. Eg a parser can return a `Nullable{Int}()` if it could not parse something as an integer.

`NA` is a value that indicates “missing data”. This works, but it is hard to optimize. `Null` is the next round in the design of missing value handling.

It is somewhat confusing, as developers are trying to find the solution which is _both_ fast and convenient.

---

<div class="post-metadata">

**Author:** ![nalimilan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nalimilan/32/147_2.png) [@nalimilan](https://discourse.julialang.org/u/nalimilan)\
**Post date:** [October 16, 2017, 2:52pm UTC](https://discourse.julialang.org/t/whats-the-difference-between-null-na-null-nothing/6468/3 "2017-10-16T14:52:25Z")

</div>

`#NULL` is just the way `Nullable()` (i.e. a null `Nullable`) is printed in some contexts. `nothing` is the value returned by code blocks and functions which do not return anything, and it’s also used in some places to signal the absence of a value (in a type-unstable way). The empty string is, well, just a string with no characters.

Hopefully `Nullable` and `NA` will go away before Julia 1.0. There will remain `null` (of type `Null`) and `nothing` (of type `Void`), the main difference being that `null` propagates silently (e.g. `1 + null === null`), just like `NA` did in DataArrays (and in R, like SQL’s `NULL`). These are sometimes referred to respectively as the data scientist’s null (`null`) and software engineer’s null (`nothing`).

For more details, see [this issue](https://github.com/JuliaLang/julia/issues/22682).

---

<div class="post-metadata">

**Author:** ![evanfields](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/evanfields/32/1744_2.png) [@evanfields](https://discourse.julialang.org/u/evanfields)\
**Post date:** [October 16, 2017, 2:59pm UTC](https://discourse.julialang.org/t/whats-the-difference-between-null-na-null-nothing/6468/4 "2017-10-16T14:59:10Z")

</div>

If `null` propagates silently and `nothing` does not, e.g. `1+nothing` is an error, doesn’t that make `null` for data scientists and `nothing` for software engineers, not vice versa?

---

<div class="post-metadata">

**Author:** ![nalimilan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nalimilan/32/147_2.png) [@nalimilan](https://discourse.julialang.org/u/nalimilan)\
**Post date:** [October 16, 2017, 3:51pm UTC](https://discourse.julialang.org/t/whats-the-difference-between-null-na-null-nothing/6468/5 "2017-10-16T15:51:10Z")

</div>

> [@evanfields](#):
>
> If null propagates silently and nothing does not, e.g. 1+nothing is an error, doesn’t that make null for data scientists and nothing for software engineers, not vice versa?

Right! I added these after writing the sentence for clarity, and of course I got the order wrong. Fixed.

---

<div class="post-metadata">

**Author:** ![sylvaticus](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sylvaticus/32/203883_2.png) [@sylvaticus](https://discourse.julialang.org/u/sylvaticus)\
**Post date:** [August 17, 2018, 12:44pm UTC](https://discourse.julialang.org/t/whats-the-difference-between-null-na-null-nothing/6468/6 "2018-08-17T12:44:56Z")

</div>

For those reading this thread in post Julia 1-0, what at the end remained is:

- `nothing` as the software engineer’s null (most operations using it will emit run time errors)
- `missing` as the data scientist’s null (propagates silently)

---

<div class="post-metadata">

**Author:** ![sylvaticus](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sylvaticus/32/203883_2.png) [@sylvaticus](https://discourse.julialang.org/u/sylvaticus)\
**Post date:** [April 17, 2019, 10:25am UTC](https://discourse.julialang.org/t/whats-the-difference-between-null-na-null-nothing/6468/7 "2019-04-17T10:25:42Z")

</div>

I revive this thread to post a nice BBC video about the history of the concept of zero:

> **[A short history of nothing - BBC Ideas](https://www.bbc.co.uk/ideas/videos/a-short-history-of-nothing/p076bm46)**
>
> Did you know the word "naughty" comes from nought? And zero was once seen as the antithesis of God? Here's how nothing became something.
