I use pretty much the same style for my Ruby work. One thing I do differently is replacing
%w(word1 word2 word3)
with
%w[word1 word2 word3]
both result in
["word1", "word2", "word3"]
I prefer the bracket delimiters since they better indicate the array nature than the parens. In % notation you can choose your own delimiters, so why not use brackets?
Comments
I use pretty much the same style for my Ruby work. One thing I do differently is replacing
with both result in I prefer the bracket delimiters since they better indicate the array nature than the parens. In % notation you can choose your own delimiters, so why not use brackets?Both are fine.
Just don't use linebreaks or weird utf8 characters, please.
EDIT: As delimeters. Feel free to use them inside the strings.