23 ms·
> I think the drama in XML usage ... What about: - verbosity - complexity of writing a parser - complexity of dumping data - DTDs - data model which doesn
by dolmen 5y ago
> I think the drama in XML usage ...
What about:
- verbosity
- complexity of writing a parser
- complexity of dumping data
- DTDs
- data model which doesn't map directly to a scalar/array/associative array
... and so many other XML features that are either useless or painful just for RPC.
- oaiey 5y agoVerbosity is not a thing. We read HTML all the time. Parser writing and dumping of data is equally complex for both JSON and XML. The only difference is that in JavaScript JSON is so much simpler due to the dynamic nature of the language and the core library. Out-of-the-box XML parsing in JS is just stone-age. Compare that to .NET System.Xml.XDocument and Newtonsoft.Json, then you can see the simplicity how an API could look (in a static type system ;)) No one needs DTDs. No modern contract is every spec'ed in DTDs. XSDSchema has superseeded that 20 years ago. The only issue with it, is that some entry level tutorials are still mentioning it. The data model mapping depends a lot on the target language. In JavaScript XML is not a match but JSON is. Working with JSON in C++ is equally stupid as working with XML is. The only stupid feature in XML is namespaces. Without that, it is simple.
- theamk 5y ago> Parser writing and dumping of data is equally complex for both JSON and XML. Strongly disagree. Sure, you can make XML which is easy to parse, but parsing arbitrary XML is hard. Namespaces (and their short prefixes), and custom entities are something that fly in my face any time I use XML but simply do not exist in JSON. Dumping is usually OK but again, I've seen XML libraries replace short namespace prefixes with full URLs when dumping, making simple documents unreadable.