Phlip
8/23/2008 6:25:00 PM
Dave Bass wrote:
> But unfortunately Ruby regards both false and nil as not-true. For some
> reason, this is touted as a feature.
>
> False and nil are two quite different concepts and should not be
> conflated.
So the Ruby version would work like:
if agent.index('googlebot')
So, once again, Ruby gives us the right defaults, precedents, and operations
that do much more, with much less code.
If you need false==, to self-document with more code, go for it. Given the
choice of forcing you to conflate 0, FALSE, and NULL, and only conflating
two of them, Ruby picked the right two, for nearly all situations. If you
want Pascal or Ada, you know where to get them!
--
Phlip