3 ms·
XML is way more complex than YAML. XML has not only all the indirection troubles of YAML, but even freer indirection (you can point to the web!), partial data,
by marcosdumay 5y ago
XML is way more complex than YAML. XML has not only all the indirection troubles of YAML, but even freer indirection (you can point to the web!), partial data, substandards, foreign includes, and a lot of extra things.
Just like YAML, there exist a sound subset of XML that is quite usable. Just like YAML, XML is hard to write correctly, but I would say the XML errors are much easier to spot.
Both JSON and YAML have the problem of lacking tagged unions. Also, the XML data definition can be either extra complexity or a great tool depending on your usage. (But DTDs use an atrocious language either way.) None of those 3 standards have a really universal type representation, and while there are substandards for XML that extend the types, I've never seen anything that could encode even the C type system.
- GoblinSlayer 5y agoYep, anything is hard to write. What's more important, YAML is hard to read, and it's by design as its markup was intended to be as invisible as possible.
- marcosdumay 5y agoHum... JSON is quite easy to write. Too bad the lack of comments makes it unmaintainable. As the OP said, the quest for the perfect data language is still on.
- GoblinSlayer 5y agoHard to write as in you can botch it up. With JSON you need to be careful to close all the tiny braces, sometimes far apart.
- rishav_sharan 5y agoFirst time I have heard that YAML is harder to read compared to XML. XML might have many upsides over YAML, but readability isn't one of them
- GoblinSlayer 5y agoIf by readability you mean invisible markup, yes, that's what YAML does well.
- rishav_sharan 5y agoBy readability, I mean readability. The ability to understand whats in there, in a glance. JSON and YAML and vastly more readable than XML.
- kaba0 5y agoSure it’s readable for like 3 lines of code - the exact same way as XML is. But YAML’s readability scales the worth out of the 3.