Best way to store config or preferences in a multi-platform way.

Ivan Illarionov ivan.illarionov at gmail.com
Thu May 1 20:20:56 EDT 2008


On Fri, 02 May 2008 01:21:38 +0200, Torsten Bronger wrote:

> Hallöchen!
> 
> Ivan Illarionov writes:
> 
>> [...]
>>
>> For me it looks more like an old-school/new-school thing than use-case
>> thing. I may be wrong, but I see more and more new projects use things
>> like reST and YAML/JSON and it feels like they are gradually replacing
>> traditional old-school solutions.
>>
>> And I've got very strong impression that YAML is a the future of
>> configuration files when Google released their App Engine.
> 
> In contrast to many other areas of software, configuration files needn't
> be compatible with anything except the user's brain.  So even if the
> rest of the world uses config format X, you can safely stick with config
> format Y.

There are several reasons for compatibility:

1. The user or another developer might want to write GUI front-end to 
configure your app. With standard format this would be easier.

2. Similar apps might want to have a feature like "import settings" from 
other apps. Traditional config files made this PITA -- and that's why 
this feature is extremely rare.

3. Bigger applications that include your sofware as one of its components 
may need to automate configuration process and update several config 
files of different smaller apps from one global setting.

That's precisely why first XML and now YAML became popular for config 
files.

> I mean, YAML is not really a complex thing, yet it was conceived not
> before 2001.  The reason is that traditional config files do a good job.
> 
> Tschö,
> Torsten.

-- 
Ivan



More information about the Python-list mailing list