Forgot your password?
typodupeerror

Comment Re:What are you talking about? (Score 1) 312

XML is not 'just text'. It is encoded in a text-based format, agreed, but so what? The data encoded will not be used/processed/displayed as text. XML offers flexibility and a degree of naked-eye readability, but storing data in an implementation-specific manner can offer significant optimisations.

A key example is relational data. Here, XML is inefficient, not because of verbose tags or other bloat, but because of its flexibile structure.

Take it away, Joel:

How does a relational database implement SELECT author FROM books? In a relational database, every row in a table (e.g. the books table) is exactly the same length in bytes, and every fields is always at a fixed offset from the beginning of the row. So, for example, if each record in the books table is 100 bytes long, and the author field is at offset 23, then there are authors stored at byte 23, 123, 223, 323, etc. What is the code to move to the next record in the result of this query? Basically, it's this:
pointer += 100;

One CPU instruction. Faaaaaaaaaast.

Now lets look at the books table in XML.

<?xml blah blah>
<books>
<book>
<title>UI Design for Programmers</title>
<author>Joel Spolsky</author>
</book>
<book>
<title>The Chop Suey Club</title>
<author>Bruce Weber</author>
</book>
</books>

Quick question. What is the code to move to the next record?

Uh...

Slashdot Top Deals

Real programmers don't write in BASIC. Actually, no programmers write in BASIC after reaching puberty.

Working...