[chef] Re: Re: Re: Re: Re: Re: Re: FC001, attributes as strings vs symbols


Chronological Thread 
  • From: Peter Donald < >
  • To:
  • Subject: [chef] Re: Re: Re: Re: Re: Re: Re: FC001, attributes as strings vs symbols
  • Date: Thu, 18 Oct 2012 06:07:13 +1100



On Thu, Oct 18, 2012 at 5:00 AM, Josiah Kiehl < " target="_blank"> > wrote:
I just turn off this check and let people do what they will. I personally use symbols as it's more comfortable given I was a ruby developer before I learned Chef.


I used to use symbols but then changed to strings due to FC001 and hated it at first as I used to write a lot of rails code and it seemed a foreign code style. However overtime I got used to it and have found it is easier to teach people about chef with it. It is also much easier when you start mixing content into node attributes (i.e. we deep merge data bag data into node attributes or extract json config from other services) as you don't have to think about whether you can use symbols or strings in a particular case - you always use strings.

I think Chef would be much easier to teach and learn if there was a single way of doing things.   Cookbooks would be consistent and easier to read. The other techniques could be removed form the core but if people wanted to use them they could always readd them through a support cookbook that monkey patched the right classes.

--
Cheers,

Peter Donald



Archive powered by MHonArc 2.6.16.

§