i have read lots of resources about ruby symbol, but i’m still very
confused about it!
when i write a rails project, i can not distinguish the difference
like the subject above and in fact it seems the same when browsing
through two different computers , why?
when i write a rails project, i can not distinguish the difference
like the subject above and in fact it seems the same when browsing
through two different computers , why?
Although :index and “index” are two very different things, Rails
implements something called HashWithIndifferentAccess that means you
can get away with using either.
It’s better to use :symbols than “strings” where you can, because a
symbol is stored only once in memory, whereas a string requires an
extra copy each time you refer to it.
There’s an excellent explanation at
http://glu.ttono.us/articles/2005/08/19/understanding-ruby-symbols
.
Gwyn.
On 3ÔÂ7ÈÕ, ÏÂÎç3ʱ58·Ö, “Gwyn Morfey” [email protected] wrote:
extra copy each time you refer to it.
There’s an excellent explanation athttp://glu.ttono.us/articles/2005/08/19/understanding-ruby-symbols
.Gwyn.
Thank you!