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

    Most web frameworks contain code to exchange JSON over XMLHttpRequest for a reason. XML is and always has been a data transfer format as well as a file format. JSON is, too. The amount of config.jsons I’ve had to mess with…

    but using XML to communicate between your app’s frontend and backend wouldn’t be either

    I don’t see why not? The entrypoint of web frontends is sent as HTML already. I guess that’s based on SGML, XML’s weird and broken cousin. Outputting XML is just a matter of configuring whatever model serialiser from JSON to XML.

    There are a few good arguments against XML, but those also work against JSON.

    • schnurrito@discuss.tchncs.de
      link
      fedilink
      arrow-up
      0
      ·
      1 year 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.

    • MonkderVierte@lemmy.ml
      link
      fedilink
      arrow-up
      0
      ·
      1 year ago

      The amount of config.jsons I’ve had to mess with…

      Yeah, json is not a good config format. As much as xml is not. Please use something like YAML or TOML.

      • sysop@lemmy.world
        link
        fedilink
        arrow-up
        1
        ·
        1 year ago

        I never moved away from ini I’ve just been sititng back watching you all re-invent the wheel over and over and over and over and over.