One of the important aspects of Ruby 3.0 is optimization. One of the optimizations is the introduction of the 'name' method for Symbol. It converts a symbol to a string but how it is differerent from \`to\_s\`? Read more at [Ruby 3 Symbol Name ](https://blog.bigbinary.com/2020/10/12/ruby-3-adds-symbol-name.html).
1 thought on “Ruby 3 adds a ‘name’ method on Symbol class”
Seems odd to me to add .name rather than just making to_s return the same frozen string consistently. To get the performance benefit I need to know this bit of trivia. Who is going around needing to mutate copies of strings?