Preferences

XML was indeed better.

IshKebab
It absolutely wasn't, primarily because the XML data model is so mismatched with the object structures you find in programming languages.

It does at least support comments though. Biggest flaw in JSON by far.

wtetzner
> primarily because the XML data model is so mismatched with the object structures you find in programming languages

I dunno, it matches up reasonably well with languages that have nestable custom types.

XML labels nodes, and JSON labels edges. They both have pluses and minuses.

IshKebab
XML nodes have attributes and contents. No programming language I know of works like that.
wtetzner
It doesn't seem like an especially important distinction. I've never understood why people always make such a big deal about it.
IshKebab
It's a big pain when decoding XML. That's not the only impedance mismatch. The fact that XML is just a soup of objects is not how programming language objects work either.

https://docs.rs/serde-xml-rs/0.6.0/serde_xml_rs/#caveats

Look at how much more complex this is than the equivalent JSON code, which requires none of these annotations:

https://docs.rs/strong-xml/latest/strong_xml/

Yet still very inefficient.
Tao3300
Apples and oranges.
To me XML and JSON are actually technically quite similar, and both have been touted in their heyday for similar reasons over more apt format (auto-documented! simple to implement an ad-hoc serializer!).

Would you mind explaining why you thinks it is an apple and oranges comparison?

Tao3300
One is a markup language. The other is an object notation.
Clamchop
I'd say that's part of the calculus for comparison. Comparing apples and oranges isn't nonsensical if what you need is a fruit. XML and JSON are alternatives for many use cases, so you can evaluate if markup and schemas are valuable enough to be worth the added hassle.

This item has no comments currently.