1. Technology
Send to a Friend via Email
You can opt-out at any time. Please refer to our privacy policy for contact information.

Definition: The value 'nil' is used to refer to something that has no value. This is different than 0 (a number with no value) or false (a boolean with a false value). The value 'nil' means "no value." That might be difficult to think about, many languages don't have an equivalent. C programmers have NULL, but that means "points to nothing," which is not exactly the same thing as it's only used with pointers. Just know that 'nil' is used for things like undefined variables, or when a method doesn't return anything. When used in a boolean statement, it evaluates to 'false.'  Nil is the only value in Ruby that evaluates to false apart from false itself.

©2014 About.com. All rights reserved.