Why Ruby has Symbols

Many people who come to Ruby start using symbols on their first day. Come on, Getting Started with Rails shows you symbols in the first migration you generate! From the first glance, symbols look like strings (:hi versus "hi") and can be converted back and forth. The naive explanation of their difference is that strings are used to represent some data (e.g., constant or variable values), while symbols usually appear as a part of the code (e.g., arguments of method calls). However, why do we have both? Let’s figure that out!.
Why Ruby has Symbols #ruby #rubydeveloper #rubyonrails https://rubyonrails.ba/single/why-ruby-has-symbols

Nezir Zahirovic

Contractor Ruby On Rails (8+ years) / MCPD .Net / C# / Asp.Net / CSS / SQL / (11 years)

related articles