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?
on 2007-03-07 08:16
on 2007-03-07 09:00
> 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/understand... . Gwyn.
on 2007-03-07 10:48
On 3ÔÂ7ÈÕ, ÏÂÎç3Ê±58·Ö, "Gwyn Morfey" <dezyne....@googlemail.com> wrote: > extra copy each time you refer to it. > > There's an excellent explanation athttp://glu.ttono.us/articles/2005/08/19/understand... > . > > Gwyn. Thank you!