[Catalyst] YAML vs. *

Kiki kiki at bsdro.org
Sat Jun 10 18:07:19 CEST 2006


Matt S Trout wrote:
> Kiki wrote:
>> Decision-taking offtopical $0.02: I recently read a book in which the
>> author suggests to have people make preference lists and choose the most
>> common _second_ choice listed, based on the theory that people would put
>> their (sometimes/mostly unreasonable) "pet" choice first and the most
>> reasonable choice after that. Of course it would require either honest
>> choices or the people involved not to be aware of the selection process ...
>
> Yeah, quite possibly. Maybe we need a catdot.org and a poll :)
Yeah, polls would be interesting. I'll look if there's trac plugin for
such things.
> <Foo>
>    <Bar>
>      Baz Quux
>    </Bar>
> </Foo>
>
> { Foo => { Bar => { Baz => 'Quux' }
>
Yes, I read the docs more thoroughly** afterwards :)

As seems to be the case with every parser that has parsing options C::G
provides for several gotchas (ex. <Directory />) which while
circumventable by these options, are nonetheless confusing when you
expect things to just work.
>> For tutorials and (simple) config examples, simple, widely known and
>> robust is better, therefore INI-style would be the best choice. Apache
>> style second (not as widely known)
>
> Are you sure that's true for people deploying webapps?
No, I'm not sure at all, it's just an semi-informed guess. More guesses:
Newbies probably

- don't deal with Apache configs unless they're admin for an Apache
server, or fiddle around with mod_perl (re: C::G)
- don't care about spaces vs. tabs unless they're into Makefiles, python
or YAML. Sure, any decent editor can convert tabs to spaces for them,
but unless they've been bitten by the issue a couple of times, they just
don't care enough. (re: YAML)
- are generally prone to throw everything (i.e. complex data structures)
into the config file (after getting over the hardcoding stuff in the
code phase) (re: INI)
>> For defaults when generating an new app, perhaps a switch to specify
>> default format, with default format value same as the one used in
>> tutorials so as not to confuse newbies, and even if you forgot to
>> specify one you could use the conversion tool...
>
> Yeah, but first let's get a cribsheet into the default .yml file and then we 
> can look at hacking on catalyst.pl's functionality ...
Cribsheet like in comments with hints? Like this:

---
# Please convert spaces to tabs before saving and keep in mind that
whitespace and indentation are important
# To specify an array of values use dashes (keep at least one space
between the dash and the value):
# - foo
# - bar
# To specify a hash of values use colons (keep at least one space
between the colon and the values):
# foo: bar
# baz: quux
#
 etc .





More information about the Catalyst mailing list