[Catalyst] YAML vs. *
Matt S Trout
dbix-class at trout.me.uk
Sun Jun 11 15:54:49 CEST 2006
Kiki wrote:
> A. Pagaltzis wrote:
>> And it’s very easy to figure out what goes where just
>> by looking at the format; no manual or cheat sheet necessary.
>>
>
> It is to me too after years of editing apache config files. The first
> months of dealing with it however were hell, esp. in regard to directive
> and options overriding.
Yeah, although that's more down to the way apache processes it than the syntax
itself.
> The point is any sufficiently complex data structure will be confusing
> no matter what format it is expressed as. Once you get familiar with it
> (the data structure, not the format), you will be able to deal with the
> format as well (YMMV, though).
Yep. Complex configs are always a bit confusing. Config::General doesn't fix
this, it just seems (at least to me) to suck less than the available alternatives.
>>> Well, the "perl way" would be Data::Dumper + eval in a Safe
>>> compartment. It's indent insensitive, doesn't look like XML
>>> (which is my pet peeve regarding C::G) and instantly
>>> readable/writable if you know Perl.
>>>
>> Suffers from the same problems as JSON and YAML: hard to write
>> for non-programmers. Also hard to read, like JSON.
>>
> I don't see why writing YAML would get suddenly easier if you learned a
> programming language. It's a matter of conventions. If the user is
> inexperienced enough to really mess up indentation (after being warned
> about it), chances are he'll forget to close tags, misspell option names
> or set creative option values like: "Allow from all my friends" or "Deny
> from Russia" [with love] ;) too.
I definitely prefer JSON to YAML for that sort of side. JSON is still
fundamentally a structured data format, not a config file format, but it's
more explicit than YAML and I can't fuck myself up with whitespace errors,
which is bloody handy.
I used .json for my conf files fairly religiously before ConfigLoader
supported Config::General.
--
Matt S Trout Offering custom development, consultancy and support
Technical Director contracts for Catalyst, DBIx::Class and BAST. Contact
Shadowcat Systems Ltd. mst (at) shadowcatsystems.co.uk for more information
+ Help us build a better perl ORM: http://dbix-class.shadowcatsystems.co.uk/ +
More information about the Catalyst
mailing list