---
title: "Ruby 2.4 deprecated constants TRUE, FALSE & NIL"
description: "Ruby 2.4 has deprecated toplevel constants TRUE, FALSE and NIL"
canonical_url: "https://www.bigbinary.com/blog/ruby-2-4-has-depecated-constants-true-false-and-nil"
markdown_url: "https://www.bigbinary.com/blog/ruby-2-4-has-depecated-constants-true-false-and-nil.md"
---

# Ruby 2.4 deprecated constants TRUE, FALSE & NIL

Ruby 2.4 has deprecated toplevel constants TRUE, FALSE and NIL

- Author: Akshay Vishnoi
- Published: June 19, 2017
- Categories: Ruby 2.4, Ruby

Ruby has top level constants like `TRUE`, `FALSE` and `NIL`. These constants are
just synonyms for `true`, `false` and `nil` respectively.

In Ruby 2.4, these constants are
[deprecated](https://bugs.ruby-lang.org/issues/12574) and will be removed in
future version.

```ruby
# Ruby 2.3

2.3.1 :001 > TRUE
 => true
2.3.1 :002 > FALSE
 => false
2.3.1 :003 > NIL
 => nil
```

```ruby
# Ruby 2.4

2.4.0 :001 > TRUE
(irb):1: warning: constant ::TRUE is deprecated
 => true
2.4.0 :002 > FALSE
(irb):2: warning: constant ::FALSE is deprecated
 => false
2.4.0 :003 > NIL
(irb):3: warning: constant ::NIL is deprecated
 => nil
```

## Links

- [Human page](https://www.bigbinary.com/blog/ruby-2-4-has-depecated-constants-true-false-and-nil)
