From: David Naseby Date: 2004-05-19T12:42:48+09:00 Subject: Re: Zero is true ... whoda thunk? >-----Original Message----- >From: Michael Geary [mailto:Mike@DeleteThis.Geary.com] > >Because in the real world, zero means false. > >Suppose you have zero quarts of milk in your refrigerator. I >am visiting and >I ask: > >Got milk? > >What's your answer, yes or no? > >No, of course. I'd prefer to encode this as: if got_milk? ... end where def got_milk? @milk_volume.zero? end vs. if @milk_volume ... end If milk volume is what? It just doesn't read well, it doesn't express intent.. its just poor coding, really. I'd contend there's more of a "geeky kind of logic" in 0 meaning false. David http://homepages.ihug.com.au/~naseby/