2 ms·
XML has its bad sides (hell, I won't ever forget hacking Perl's SOAP::Lite to make it be able to talk with some extremely enterprisey Java service), but its cor
by drdaeman 10y ago
XML has its bad sides (hell, I won't ever forget hacking Perl's SOAP::Lite to make it be able to talk with some extremely enterprisey Java service), but its core isn't as bad as many try to picture it.
The really good thing about XML, that it - unlike JSON - is extensible.
And traversing both JSON and XML (without the weird parts) are no-brainers. Every (or about so) mainstream language has libraries that make either format really transparent to use.
- gnaritas 10y ago> Every (or about so) mainstream language has libraries that make either format really transparent to use. That's really only true about XML, that is not the case with JSON. JSON is a pain to work with in C# for example compared to XML.
- drdaeman 10y agoI have different experience. I did some toy project in C# and haven't found handling JSON any painful. Maybe I just haven't hit the bad cases, though. I don't exactly remember what I've used and what I wrote, but I think I had just installed some library (IIRC it was Json.NET), put some annotations on classes, and got my serialization. For deserialization I didn't wanted to write throwaway classes so I just made a JSONPath query and iterated over the result objects, looking at necessary properties. Nothing particularly different from how things are in, say, Python, except maybe for some extra type checking.