Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP


Initializers of Array, Hash and Set #89

SirLenz0rlot opened this Issue · 1 comment

2 participants



I miss some rules on the initializers of Arrays and Hashes. I prefer to use
{} and [] over and

Sets are a bit more difficult, I myself use, when an array is empty but otherwise [foo, bar].to_set.

Another notation of this would be Set[foo, bar], but i prefer the other.

Any comments?


I totally agree. It's not included in the guide, since I doubted anyone would create an empty array or hash without the literal syntax.

@amiel amiel referenced this issue from a commit in amiel/ruby-style-guide
@bbatsov fixed #89 - favor the use of array and hash literals for their creation d6e592e
@JuanitoFatas JuanitoFatas referenced this issue from a commit in JuanitoFatas/ruby-style-guide
@JuanitoFatas JuanitoFatas update chinese version of #66, #89, exception, array&hash, extra quot…
@bbatsov bbatsov closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.