3 ms·
XML is inefficient to read and write by both computers and humans; might as well use JSON as your serialization format, it's at least more human readable.
by sagarm 4y ago
XML is inefficient to read and write by both computers and humans; might as well use JSON as your serialization format, it's at least more human readable.
- denkmoon 4y agoUse JSON and you lose type information, schemas, and relationships. Of course you can add all that back to JSON as many people have done in various ad-hoc ways. JSON is inferior to XML in every way except "I don't want to type angle brackets and closing tags". I encounter a lot of people stating your position, that reading JSON is faster than reading XML, for a human. I cannot speak to the subjective experience of anyone but myself of course, but IMO that's a load of bunk. Spent most of my career looking at both XML and JSON, and the only time I ever have a problem is when it's not formatted/indented. We have tools for this, of course. Yet to encounter a situation where the performance of the XML parser was a limiting factor in the system I am working on. RapidXML and RapidJSON are both insanely fast if you use them as intended. If you are encountering performance issues from parsing XML you almost certainly want to move to a binary format anyway.
- sagarm 4y agoI don't want to type or parse duplicate tags and angle brackets. It's nonsense for a human readable format. I work on low latency distributed systems where performance does matter. We use proto wire format mostly. Proto has its own human readable text format that I prefer because it's more convenient than JSON (no commas, unquoted keys), but I'd pick JSON over XML any day.