[Dancer-users] YAML, why?

Robert Olson bob at rdolson.org
Wed Sep 22 19:35:01 CEST 2010


On Sep 22, 2010, at 11:42 AM, P Kishor wrote:

> Hi Alexis,
> 
> 
> On Wed, Sep 22, 2010 at 8:54 AM, Alexis Sukrieh <sukria at sukria.net> wrote:
>> Le 22/09/2010 14:24, P Kishor a écrit :
>>>> 
>>>> Configuration files, on the other hand, are not meant to be written with
>>>> a
>>>> programming language.
>>> 
>>> who says so? I use PDL (Perl Data Language), a highly complex and
>>> powerful software, probably the most complex I have ever used, and all
>>> its configuration required to build it are done using a extremely
>>> readable perl data structure.
>> 
>> Well, Dancer has been written with one main idea in mind: everything should
>> be simple and intuitive.
>> 
>> If there is one reason why people like Dancer, it's because of that: it's
>> simple, intuitive and elegant.
>> 
>> YAML configuration files contribute to that, it's very handy to just drop a
>> list of key/value pairs in one config.yml file and just start working.
>> 
>> Of course you can find many examples of applications whose configuration
>> files are written with a programming language, but I dislike that.
>> 
>> Because if you let the user write his configuration files with a script,
>> sooner or later someone will start putting code inside, and that's a pandora
>> box.
>> 
>>>> YAML is a very good and well-kown format for
>>>> human-readable configuration files.
>>>> 
>>> 
>>> Again, who says so? citations?
>> 
>> My experience tells me that. Again, if you want to write pure perl Dancer
>> settings, you can do it. YAML files are there for people who want to keep
>> their settings outside of their code.
>> 
>> 
>>> Besides, who wants human-readable? I want programmer-readable. No
>>> human reads the config files on a daily basis, but my computer does
>>> all the time. I just gave you an example above where a simple
>>> indentation can cause misunderstanding both to the human and the
>>> computer.
>> 
>> I precisely want human-readable here. Again, Dancer is meant to be as easy
>> to handle as possible. It's a key feature. You won't make me change my mind
>> on this ;)
>> 
> 
> 
> My intent was not to change your mind, but just to have a
> conversation. I totally respect your decision to implement config-ing
> with YAML, but I appreciate the fact that I can also provide the same
> info as a Perl data structure via settings.
> 
> YAML itself doesn't bother me -- it is its focus on indentation and
> white space as being meaningful that bothers me. As I gave my example,
> the config code fragment for enabling utf-8 as shown on Dancer website
> croaks with an error. So, I can't even take the "canonical" example
> and cut and paste it in my code and expect it to work. That, to me,
> does not make a simple framework. That makes an needlessly fragile
> framework that is prone to errors based on which way the wind is
> blowing.
> 
> Anyway, enough said -- config is such a small part of my overall
> application that I will either learn how to implement it in YAML
> (thankfully, only very little learning required) or just use Perl

I don't recall - does Dancer use Config::Any inside? Would that address this issue?




More information about the Dancer-users mailing list