From: matt@... (matt neuburg) Date: 2009-02-22T03:10:30+09:00 Subject: Re: why not check for nil? Roger Pack wrote: > matt neuburg wrote: > > A post I ran across on a rails forum reads: > > > > "Warning! DO NOT test for nil! This is a very bad coding practice. You > > can use "if obj", but do not use "if obj.nil?" or whatever." > > > > Is that generally true? Why? m. > > because it might be false [not nil]? Yes, I thought of that too. But of course to me that is *why* I would check for nil (I really really do want to know if it's nil). Maybe the poster just didn't know what he was talking about... m. -- matt neuburg, phd = matt@tidbits.com, http://www.tidbits.com/matt/ Leopard - http://www.takecontrolbooks.com/leopard-customizing.html AppleScript - http://www.amazon.com/gp/product/0596102119 Read TidBITS! It's free and smart. http://www.tidbits.com