<p>Em 21/07/2011 23:10, "Peter Bonivart" <<a href="mailto:bonivart@opencsw.org">bonivart@opencsw.org</a>> escreveu:<br>
><br>
> 2011/7/22 Maciej BliziƄski <<a href="mailto:maciej@opencsw.org">maciej@opencsw.org</a>>:<br>
> > 1. Keep the data in a simple text format so that it is easy to read the<br>
> > right bit of data in shell<br>
><br>
> +1<br>
><br>
> > 2. Keep the data in json and provide a shell utility that prints the<br>
> > requested piece of data to stdout.<br>
><br>
> Too complicated for no particular benefit.</p>
<p>The main benefit is that you use a standard file format that gives you a data structure, e.g. a dictionary of lists.</p>
<p>To use a simple text format, we need to design it well. For example, keeping multiple dictionaries of lists in one file might be annoying to parse in shell. On the other hand, you don't want to create one file per variable, because this can kill performance (start up times). Having a command line utility has the advantage that you can change the underlying mechanics without changing the API. If you use text files, it is harder to change that because you might have 15 different parsers already scattered throughout the code (and the world), with different bugs and quirks.</p>

<p>Simple text files might still be better; I just wanted to point out that there are concrete benefits of using a standard file format. </p>
<p>Maciej</p>