- Lukasz Wrobel demystifies
nil
in Ruby
Why the id of nil is 4 in Ruby
- An older post by Neeraj Singh on
nil
'sobject_id
If You Gaze Into nil, nil Gazes Also Into You
Rails Refactoring Example: Introduce Null Object
Understanding .nil? .empty? .blank? .present? in Ruby on Rails
How To Guard Against Ruby Nil Errors
Navigating nil (Method Chaining) in Ruby
Eliminating branching, nil and attributes - let's get weird
Question: rails if object.nil? then magic '' in views?
Naught — a toolkit for building NullObject classes in Ruby
Boolean to_i feature rejection
- This is particularly interesting because Matz gives a succinct answer that explains what he intends
nil
to be andtrue
andfalse
to not be:
Ruby is not C. 0 is not false. false is not 0. nil has its role as a default value, true/false are not.