Re:Moving from Ruby to Rust
by aboutruby on Thursday February 14, 2019 @10:38PM
(#19168275)
Symbols in Ruby are basically concise strings, :id is a symbol, "id" a string. There are some differences of how they are allocated but it's mainly a style preference and a convention.
e.g. you would typically do { id: 1, name: "aboutruby" } where id and name are symbols, instead of { "id" => 1, "name" => "aboutruby" } with strings.
But really I don't see the point of removing the symbols.
e.g. you would typically do { id: 1, name: "aboutruby" } where id and name are symbols, instead of { "id" => 1, "name" => "aboutruby" } with strings.
But really I don't see the point of removing the symbols.