From: Robert Dober Date: 2007-05-05T06:34:29+09:00 Subject: Re: ruby and true On 5/4/07, aidy.lewis@googlemail.com wrote: > Paul Rogers wrote > > > as Robert has said, its generally bad to say if x==true > > Not sure why it would be bad practice to compare to true? Maybe because true is just one special value (which also evaluates to "true"). If you want to test that x is true and nothing else than it is excellent practice to write if x == true then this however is so rare a semantics that Robert and Paul are completely correct with their statement, because in 99% of the cases what you mean is unless x.nil? || x == false then which of course can and shall be written as if x then HTH Robert > > -- You see things; and you say Why? But I dream things that never were; and I say Why not? -- George Bernard Shaw