I usually use a symbol instead of a string when I use it to represent
a 'concept' meaningful to the program, rather than just some text that
is meaningful only to the user.

For example, what I used to model as 'flags' or 'options' in other
languages become symbols in ruby.

i.e: "ciao".translate_to :english

"ciao" is a piece of text meaningful to the user.  :english is a
symbol meaningful to the program.

When the concept that I represent as a symbol becomes more complex I
usually evolve it to an object.

On 3/4/06, Servando Garcia <garcia.servando / gmail.com> wrote:
> Hello all .
>     I am a newbie to Ruby. I have been reading everything I can get my
> hands on about Ruby. I understand what a symbol is and how it saves
> memory space. I just can not seem to find any good reason to use one. I
> am sure I am missing something. Would some one please show me a good
> working example for using a symbol, please not the "Foo Bar" example again.
>
>
> Sam
>
>
>


--

-- Chiaroscuro --
Liquid Development Blog: http://feeds.feedburner.com/blogspot/liquiddevelopment