| ▲ | vbezhenar 6 hours ago | |||||||||||||||||||||||||||||||
XML is fundamentally incompatible with commonly used programming data structures, namely lists/arrays and structs/maps. That fundamental mismatch caused a lot of friction when people use XML for data exchange between programs. JSON is clear winner here. XML is absolutely fine for data that maps naturally to it. For example text markup. While HTML technically is not XML, it's very close to it and XHTML still is a thing. Probably most people wouldn't enjoy using JSON to encode HTML pages. | ||||||||||||||||||||||||||||||||
| ▲ | embedding-shape 6 hours ago | parent | next [-] | |||||||||||||||||||||||||||||||
> Probably most people wouldn't enjoy using JSON to encode HTML pages. Probably yeah, but also, people don't know how enjoyable it is to just use lists and elements within it to represent HTML. Hiccup is a great example of this where you can do something like:
And it just makes sense. I'm sure we've yet to find the best way of writing HTML. | ||||||||||||||||||||||||||||||||
| ▲ | tannhaeuser 6 hours ago | parent | prev | next [-] | |||||||||||||||||||||||||||||||
> XML is fundamentally incompatible with commonly used programming data structures, namely lists/arrays and structs/maps. Another way to say this is XML is a grammar formalism that deals purely with serialisation rather than higher-level structures that might be serialised such as co-inductive data structures. > While HTML technically is not XML, it's very close to it and XHTML still is a thing. XML and HTML-as-serialisation-format are both subsets of SGML. | ||||||||||||||||||||||||||||||||
| ▲ | hnlmorg 5 hours ago | parent | prev | next [-] | |||||||||||||||||||||||||||||||
It isn’t incompatible. It’s just a massive superset of what is needed. JSON offers simplicity YAML offers readability XML offers a massive feature set. For what we need 99% of the time, simplicity and/or readability is a much higher requirement. As for TOML, I honestly don’t understand why anyone likes that. | ||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||
| ▲ | cess11 3 hours ago | parent | prev | next [-] | |||||||||||||||||||||||||||||||
"XML is fundamentally incompatible with commonly used programming data structures, namely lists/arrays and structs/maps. That fundamental mismatch caused a lot of friction when people use XML for data exchange between programs. JSON is clear winner here." I'm not so sure about this. When you have a schema it becomes possible to generate your object code, and then your only immediate interface with the XML file is a rather simple instruction to unmarshal it, the rest of the time you're dabbling within your programming language of choice. | ||||||||||||||||||||||||||||||||
| ▲ | tclancy 6 hours ago | parent | prev [-] | |||||||||||||||||||||||||||||||
Huh? I always felt some of the failure/ bad reputation of XML was how it got tortured by devs who did not understand database normalization. If you “get” 3rd form normalization, xml works fine for the relations you describe, unless I am missing something. To be clear, I am not being snide and would be interested in the cases you’re thinking of. | ||||||||||||||||||||||||||||||||