• schnurrito@discuss.tchncs.de
    link
    fedilink
    arrow-up
    0
    ·
    2 months ago

    Of course you can use XML that way, but it is unnecessarily verbose and complex because you have to make decisions, like, whether to store things as attributes or as nested elements.

    I stand by my statement that if you’re saving things to a file you should probably use XML, if you’re transferring data over a network you should probably use JSON.

    • Skull giver@popplesburger.hilciferous.nl
      link
      fedilink
      English
      arrow-up
      0
      ·
      2 months ago

      Of course you can use XML that way, but it is unnecessarily verbose and complex because you have to make decisions, like, whether to store things as attributes or as nested elements.

      That’s a rather annoying shortcoming of XML, I agree. Then again, the choice is pretty inconsequential and the XSD for your data exchange format will lift any ambiguity anyway.

      The choice between XML and JSON are a matter of preference, nothing more. XML is much more powerful than JSON and it’s usually a better choice in my opinion, but if you’re writing your applications well, you may as well be sending your data as pixels in a PNG because your serialiser/deserialiser should be dealing with the file format anyway.