ruby strings and symbols
i want to explain the difference between strings and symbols in ruby. strings are surrounded by single or double quotes, symbols starts with colon.
strings are equal
"hello" == 'hello'
=> true
:hello == :hello
=> truebut string and symbol aren’t
"hello" == :hello
=> falsethe other thing is that strings are mutable objects but symbols aren’t. also each string has its own place in memory allocated. symbols share same space in heap