From: Robert Klemme Date: 2011-07-25T17:42:30+09:00 Subject: Re: Please give simple example of when to use symbols On Mon, Jul 25, 2011 at 9:51 AM, 7stud -- wrote: >> "good" and "good" and "bad" (3 strings) take up memory.  Why >> is that?  Isn't the second "good"  same as the first? > > Quotes are a shortcut for writing String.new--but not exactly.  In other > words, quotes tell ruby to create a new object, and if you tell ruby to > create a new object, it will do your bidding. > >> When do you normally use a symbol instead of a string? > > The easiest thing to do is never use symbols--symbols aren't worth the > waste of time trying to understand them.  Although, the idiotic > explanations I read are pretty hilarious.   If you understand pointers, > then symbols are easy to understand.  If you don't know what a pointer > is, then you won't ever understand symbol.  You can rub all the crystals > you want and mediate on "the essence" of the thing, but you won't have > any idea what you are dealing with. Why so grumpy? I can but support what Adam said. Symbols are useful and it does make sense to use them as has been argued numerous times here. The fact that you find that idiotic and hilarious probably tells more about you than about the reasons which were given. > Symbols also emit hydrocarbons, so they contribute to global warming. So do humans... Cheers robert -- remember.guy do |as, often| as.you_can - without end http://blog.rubybestpractices.com/