From: John Joyce Date: 2007-10-16T14:07:30+09:00 Subject: Re: nil.to_i returning zero Jörg put it well. nil in Ruby is very useful. nil has methods that are convenient. Most singletons have very convenient methods. If nil.to_i bothers you, you might consider that your objects or algorithms are off the Ruby way. It is entirely convenient and useful sometimes to have a to_i for nil and that it should be zero. It doesn't mean that : nil == 0 it means : nil.to_i == 0 Not: nil < 1 but: nil.to_i < 1 Convenience method. In most cases nil will cause an unexpected nil object error.