From: Phlip Date: 2008-08-25T05:55:58+09:00 Subject: Re: Why 'if 0' succeeds in Ruby matu wrote: >> False and nil are two quite different concepts and should not be >> conflated. > > I agree with you. I am also used to this. nil should never == true, and > neither be == false. Every comparison with nil should just fail. Code style should prefer the if condition to pass in positive and happy-path situations. Further, the condition should also be stated positively. You are asking to write extra code - if nil != my_object - for all of your positive situations. Then, "nil not equal" is a double negative - nil and not. However, Ruby is not stopping you from writing programmer-hostile code everywhere. Go ahead and write the extra 'nil !=' if you must! > But I actually like rubys behaviour as well: I somehow think it's logically > wrong, but practical. Sorry! (-: Always remember anyone can write code that a compiler can read. It's a much bigger challenge to write code a colleague can understand. -- Phlip