Live data from Hacker News

Don't Invent XML Languages (2006)

tbray.org

21–30 of 99 posts

Re: Don't Invent XML Languages (2006)

#22

2006, well into the era of XML being the trendy fad that every piece of Serious Business software was supposed to use. Now 18 years later, JSON seems to have displaced it. Personally, I've never found text-based formats to be a good choice for data that humans will rarely need to read or write; I much prefer simple and efficient binary formats, which can be just as extensible without the additional inefficiency and n…

> I've never found text-based formats to be a good choice for data that humans will rarely need to read or write;

A computer may need to read the data millions of times, but humans only need to read it when things goes wrong. If you take the route of using a binary format, then you need to provide a robust set of tools to view, edit, debug that format. It can absolutely work, journald is binary, but has the tooling to help you get the plain text, when you need it. Protobuf could work well, but if you design your own binary data format you have to build some tooling as well.

For many (most) it doesn't matter much if you use XML or JSON, the computer will process it fast enough. If the concern is parsing speed, then yes, absolutely binary formats might be the best option. For things like HFT or anything else that processes vast volumes of data, its probably the only choice.

Re: Don't Invent XML Languages (2006)

#23
post #9

Side question: when did XML start to loose favour to JSON? Did this happen because of something in particular or was it a gradual transition?

When I was writing an xbrl-to-json library I suddenly realized that they are not perfectly transferable.

XML comes from spreadsheets, and so it was the first mover. Whereas json came from key-value pairs. I think key-value pairs are much easier to picture in your mind, and for the vast majority of work people are doing, it's just simpler.

I think XML is wildly complicated for simply APIs.

Re: Don't Invent XML Languages (2006)

#24

2006, well into the era of XML being the trendy fad that every piece of Serious Business software was supposed to use. Now 18 years later, JSON seems to have displaced it. Personally, I've never found text-based formats to be a good choice for data that humans will rarely need to read or write; I much prefer simple and efficient binary formats, which can be just as extensible without the additional inefficiency and n…

> I've never found text-based formats to be a good choice for data that humans will rarely need to read or write; A computer may need to read the data millions of times, but humans only need to read it when things goes wrong. If you take the route of using a binary format, then you need to provide a robust set of tools to view, edit, debug that format. It can absolutely work, journald is binary, but has the tooling t…

For most things, SQLite is a very good format and somehow still underused in favour of custom formats (without or with very basic) tooling.

Re: Don't Invent XML Languages (2006)

#25

2006, well into the era of XML being the trendy fad that every piece of Serious Business software was supposed to use. Now 18 years later, JSON seems to have displaced it. Personally, I've never found text-based formats to be a good choice for data that humans will rarely need to read or write; I much prefer simple and efficient binary formats, which can be just as extensible without the additional inefficiency and n…

> I've never found text-based formats to be a good choice for data that humans will rarely need to read or write; A computer may need to read the data millions of times, but humans only need to read it when things goes wrong. If you take the route of using a binary format, then you need to provide a robust set of tools to view, edit, debug that format. It can absolutely work, journald is binary, but has the tooling t…

I can read from a hexdump a few binary formats I've worked with over the years. Not really harder than learning any other language, but much more concise than text-based formats.

Re: Don't Invent XML Languages (2006)

#27
post #9

Side question: when did XML start to loose favour to JSON? Did this happen because of something in particular or was it a gradual transition?

You may enjoy this podcast episode, which tells the story of the inventor of JSON: https://corecursive.com/json-vs-xml-douglas-crockford/

Re: Don't Invent XML Languages (2006)

#28

Another standardized XML language that the article doesn't mention is RDF: https://en.wikipedia.org/wiki/Resource_Description_Framework

FYI, RDF transports graph data, where nodes MUST have a unique ID, where relationships MUST be typed, and nodes can optionally be typed. RDF has several serializtion format, one of them being XML. A binary format also exist. And the most convenient one to generate, read and understand is (imho) Turtle, aka TTL).

Re: Don't Invent XML Languages (2006)

#29
This is less about hating on XML and more about not reinventing the wheel.

I quite like XML. Things like xpath make working with it, or getting data from it much easier than JSON; though I love jq syntax and can't wait until it starts being incorporated into languages. I don't even mind xslt provided it's not being over used.

Re: Don't Invent XML Languages (2006)

#30

I still remember working briefly in 2008 with a thing called Magic (now uniPaas I think) XML all way down. Even the code : each line was a XML . You were supposed to code with a weird GUI. Still have nightmares

I liked magic actually. Mostly because many other things were worse. Table driven development or something it was called? Works for my brain.
Post reply on HN