Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> Here are some very frequently occurring examples of bad schema design:

(4 lines, 75 characters)

> Here's the right way:

(10 lines, 133 characters)

I have a suspicion as to what went wrong.



> "But if the people who made the strange decision to use XML as a data format [...] they might realise that what they're doing is unsuited to it and unergonomic

The author's point is that XML should not be a data format.


Is there logic to the authors assertion past “that isn’t what XML was intended for”? It is a pretty nice data format if you want wide compatibility and schema integration.


The point is, XML is not a data format. It’s a markup language.


I just invented XDF, it is exactly like XML, but it can be used to represent arbitrary data structures. Do you have any objections now?


XDF looks cool! Some of the design choices look pretty inefficient and arbitrary for a data format though, have you thought about rebranding it as a markup language? =] /s

The point being, I think the author is arguing you should use the right tool for the job, and XML not being designed for arbitrary data structures makes it not the right tool. Just recently people have shown you can build a raytracing engine in SQL, but if someome was arguing we shall call it SQLCycles and ship it in Blender, I'd definitely have a few objections!


It would be a rather bad design. It would not survive a good design review.


That is only valid if the XDF standard has been published by the W3C


This doesn't make any sense. W3C doesn't restrict/define use cases of XML, it defines structure and semantics thereof; using it as-if it is an XDF document is perfectly ok, just like you can use XML data for your DASH stream etc... It's a structure on top of XML structure.


In reality it's actually fine as a data format for lots of use cases.


Documents are unstructure data, markup provides structure to unstructured documents, so xml turns documents into data.


The author’s point is moot. XML is a markup language intended to convey semantics. By its nature it is a data markup language, because the intent is that a particular type of information lives in specific tags.

For humans, this is documents with certain meanings attached. For computers, it’s documents with certain meanings attached.

It’s all data. XML is a data markup language. It’s just that humans call it “semantics” in a “document.”


I really like <root name="John" city="London" />

It easy to query with xpath

It parses the same regardless of the order. With the right way, is <item><key>Name</key><value>John</value></item> the same as <item><value>John</value><key>Name</key></item> ?


Well, I would argue that he's _still_ wrong about the "right" way to represent this: the _right_ way would be: <name>John</name><city>London</city>.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: