New repository configuration ponderings

Dag Wieers dag at wieers.com
Tue May 30 08:02:13 PDT 2006


On Tue, 30 May 2006, Ralf Corsepius wrote:

> On Tue, 2006-05-30 at 11:48 +0200, Dag Wieers wrote:
> > On Tue, 30 May 2006, Ralf Corsepius wrote:
> > 
> > > There isn't any tool to provide this feature for current apt's
> > > configuration. So, all you are trying here, is to fight xml by raising
> > > additional demands.
> > 
> > Ralf, there is a big difference between the XML snippet you showed and the 
> > apt.conf snippet. It's called readability. It may not be that noticable 
> > from 1 single line, but if the complete config-file is a list of
> > 
> > 	<whateveroption1>this is some value</whateveroption1>
> > 	<somethingelse>another value</sometingelse>
> > 	<lotsmore>value1 value2</lotsmore>
> > 
> > And this with some more nesting.
>
> Now have a look into a real world apt.conf,
> e.g. /etc/apt/apt.conf.d/default.conf.
> 
> The structure is _exactly_ the same a corresponding xml one would look
> like. The only difference is the grammar.

And interestingly, it is the grammar that is making it more difficult for 
humans to work with. You might not have noticed I made a typo on purpose 
in the above.

 
> > I know lots of people would have a problem with the above. But the 
> > difference is, for this you *need* color highlighting or you go insane 
> > (well, maybe not you, but the majority does).
> > 
> > While the apt.conf format used right now (while certainly not the most 
> > simple) is much easier to parse yourself and check for correctness.
>
> Are you sure your apt.conf is correct, or is it just that the values you
> add to it are not diagnosed as errors?

Well, at least people can see much more easier what is the value and what 
is the configuration option. I think exactly that is why Apache is not 
using XML either. They still use SGML tags, but luckily not XML.

 
> >  And it 
> > makes a big difference if you have to rely on a tool to check for 
> > correctness.
>
> Yes, with xml you'd have a tool. With apt.conf you don't have any, but
> you also don't know if the config values you add to an apt.conf are
> used.

Ok. In both cases you have a tool that can check correctness, apt would 
tell you if something is wrong. The difference is, with apt.conf I would 
have a higher chance of seeing that myself. With XML I have to rely on a 
tool to tell me if I made a mistake because it's harder for a human to 
parse it.

PS I wonder why we don't program in XML if XML is so much easier to parse, 
especially for computers. In fact, I bet assembler or microcode is even 
easier...

XML is a bad interface to humans, even though there are programmers who 
write assembler directly.

Kind regards,
--   dag wieers,  dag at wieers.com,  http://dag.wieers.com/   --
[all I want is a warm bed and a kind word and unlimited power]



More information about the Apt-Rpm mailing list