[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: gEDA-user: Functional blocks and PCB format changes



On Mon, Sep 13, 2010 at 02:31:34PM -0400, Rick Collins wrote:
> At 01:44 PM 9/13/2010, you wrote:
> >On Mon, Sep 13, 2010 at 10:23:43AM -0700, Windell H. Oskay wrote:
> >>
> >> Why? I'd much rather handwrite XML than YAML.
> >
> >Really? It's not the filesize of XML documents that is the concern; it is the
> >/redundant/ filesize. Even for a single-character tag, you need to
> >type <a>...</a>,
> >which is 7 characters of non-data text.
> 
> But that is exactly what others have been saying, they are concerned
> about the file size they think they would get from XML... "I want to
> run PCB on my iPad", etc.
>

The concern here is in processing speed, not memory space. XML is very
large and complicated, and supporting it will cost us in code speed and
complexity.
 
> 
> >To contrast, in YAML you would have
> >
> >  a: ...
> >
> >which is 2 characters, plus indentation, and a lot easier both to
> >read and to type.
> >
> >
> >Practically, consider:
> >  <layer><name>my-layer</name></layer>
> >
> >Versus:
> >
> >  layer:
> >    name: my-layer
> >
> >The latter is lighter, simpler, grep-able-er, and shows a clear distinction
> >between data and metadata.
> 
> Oh?  I don't see how any of the above follow.

Really? There's less metadata, a clearer divide between fields and their
names, cleaner spacing and the same amount of information. grep and sed
can handle this with no trickery.

In YAML, the text on the left of the : is the name. The text on the right
is the data. Name-value pairs are separated by newlines.

In XML, the text inside <> is the name. The text inside >< is the data.
Name-value pairs are also separated by ><.

>  For the most part, I
> don't expect to be writing much XML by hand.  But I do expect to
> need to read it sometimes and less often edit it.  That is, the part
> where the name or other property value is typed will need to be
> changed.  Finding that value quickly and easily is what I am
> interested in.  The computer does a great job of dealing with the
> size and format of the file.  I want to use my eyes to quickly find
> the data I'm interested in.
> 

Pop open a .xlsx file and try to edit a few cells. You will find a
ludicrously inefficient file with no whitespace, and will have quite
an adventure editing it when all the data is on one line. YAML (mostly)
requires clean whitespacing and was designed to be edited by humans.

> 
> >Machine-generated XML almost never uses whitespace, so it's next to impossible
> >to determine nesting levels or document validity, not to mention grep and awk
> >being nearly useless.
> 
> The only XML I have seen is indented just as I would indent code.
> Is there something that would make it hard to output whitespace
> formatted XML?  I would think that would be up to the program.  You
> example above uses no indentation for XML, but uses indentation for
> the counter example.  Is whitespace easier to generate by machine
> for formats other than XML?
>

Not easier, just done more often.

Open an Office 2007 document, or a generated XHTML file, to see how
ugly XML can be.


Andrew
 


_______________________________________________
geda-user mailing list
geda-user@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-user