{foo: :bar} is incredibly ugly to me and confusing to read. i'd avoid that for
an intro class, well, i avoid it completely. if i'm not using hashrockets, it's
{key: 'value'}.
-n
On May 18, 2011, at 11:19 AM, James Miller wrote:
> I'm preparing slides for next week's Intro to Ruby class and wanted to get
> some opinions on 1.9 syntax.
>
> I want to encourage the use of 1.9 and teach the new syntax while referencing
> the old, but I'm on the fence about hashes where the values are symbols and
> I'm curious as to what people are doing:
>
> hash = {foo: :bar, this: :that}
> or in Rails
> has_many :users, through: :accounts, dependent: :destroy
>
> Ok? No way? Use a mix of the syntaxes depending on whether the values are
> non-symbols (yuck)?
>
> --
> SD Ruby mailing list
> [email protected]
> http://groups.google.com/group/sdruby
--
SD Ruby mailing list
[email protected]
http://groups.google.com/group/sdruby