A Rails question for Bill Clinton

If any of you remember the part of the hearings where he said:
“it depends on what the meaning of the word is is”

I recently went around in circles for awhile trying to figure out why a
simple little bit of Ruby I had written wasn’t doing what I expected it
to.

turns out I had somewhat carelessly initialized one of the terms in my
bit of Ruby code to “:false” rather than “false”.

In the process of finding this and pondering it for a bit and searching
various texts for “:false” I came to the realization that I have no
bloody idea what the heck :false means.

Can somebody help me out here? When (if ever), should I use :false
instead of false?

Same question for :true vs true? Is the answer the same?

That depends on what the meaning of the word is is…

thanks,
jp

Hi –

On Tue, 7 Aug 2007, Jeff P. wrote:

In the process of finding this and pondering it for a bit and searching
various texts for “:false” I came to the realization that I have no
bloody idea what the heck :false means.

Can somebody help me out here? When (if ever), should I use :false
instead of false?

Same question for :true vs true? Is the answer the same?

:false and :true are symbols, just like :x, :hello, and :abc. They
don’t have any relation to the objects false and true.

David

This sounds more like a rails question for Gertrude Stein, to be
honest.

There is no :there there.

:true and :false have no special meaning in Ruby. They are symbols. If
you are using them interchangeably with true and false, you’re only
creating bugs.

Really, symbols are useful wherever you might be using a string over
and over again as a token to represent some state or other. They are
more efficient than strings in this context.

google ‘ruby symbols versus strings’ and you’ll get some good results.

MIke.

On Aug 7, 2:29 am, Jeff P. [email protected]

Jeff P. wrote:

Can somebody help me out here? When (if ever), should I use :false
instead of false?

Same question for :true vs true? Is the answer the same?

That depends on what the meaning of the word is is…

thanks,
jp

Never… :string is a symbol. Its a technique used by the rails gods to
indicate that this is just anty old string, but the the name has a
meaning…

And symbols are reused throughtout the app so :string will only use
memory for one symbol even if used a 100 times in the app…

true means “true”, :true is a symbol and has nothing to do with the
boolean value…