Every time you say :rose you are referring to literally the same flower. Every "rose" might look and feel the same, but it is not the same flower.
In a lot of cases it doesn't matter whether it's the same or a copy but if you have to gather up all the roses in the garden. The symbols can fit in your hand. The strings might take up a whole shipping container.
A symbol of name :rose is literally the same object as every other symbol :rose in the application.
/developer|entrepreneur/i
Always looking for new developer talent, even those with zero experience, as you never know who's got the potential to become a great developer.
Every time you say
:rose
you are referring to literally the same flower. Every"rose"
might look and feel the same, but it is not the same flower.In a lot of cases it doesn't matter whether it's the same or a copy but if you have to gather up all the roses in the garden. The symbols can fit in your hand. The strings might take up a whole shipping container.
A symbol of name
:rose
is literally the same object as every other symbol:rose
in the application.The string
"rose"
on the other hand is new every time.Symbols are immutable which can have a positive impact on your application's speed and reliability. Once a symbol is declared, it's value is constant.
Hope that helps.
I know you're trying to prove that strings are different each time, but in your example they're all the same.
Did you have the "frozen string literal" thing still turned on?