There exists a peculiar amnesia in software engineering regarding XML. Mention it in most circles and you will receive knowing smiles, dismissive waves, the sort of patronizing acknowledgment reserved for technologies deemed passé. “Oh, XML,” they say, as if the very syllables carry the weight of obsolescence. “We use JSON now. Much cleaner.”

  • calliope@retrolemmy.com
    link
    fedilink
    arrow-up
    13
    ·
    edit-2
    4 hours ago

    There exists a peculiar amnesia in software engineering regarding XML

    That’s for sure. But not in the way the author means.

    There exists a pattern in software development where people who weren’t around when the debate was actually happening write another theory-based article rehashing old debates like they’re saying something new. Every ten years or so!

    The amnesia is coming from inside the article.

    [XML] was abandoned because JavaScript won. The browser won.

    This comes across as remarkably naive to me. JavaScript and the browser didn’t “win” in this case.

    JSON is just vastly simpler to read and reason about for every purpose other than configuration files that are being parsed by someone else. Yaml is even more human-readable and easier to parse for most configuration uses… which is why people writing the configuration parser would rather use it than XML.

    Libraries to parse XML were/are extremely complex, by definition. Schemas work great as long as you’re not constantly changing them! Which, unfortunately, happens a lot in projects that are earlier in development.

    Switching to JSON for data reduced frustration during development by a massive amount. Since most development isn’t building on defined schemas, the supposed massive benefits of XML were nonexistent in practice.

    Even for configuration, the amount of “boilerplate” in XML is atrocious and there are (slightly) better things to use. Everyone used XML for configuration for Java twenty years ago, which was one of the popular backend languages (this author foolishly complains about Java too). I still dread the massive XML configuration files of past Java. Yaml is confusing in other ways, but XML is awful to work on and parse with any regularity.

    I used XML extensively back when everyone writing asynchronous web requests was debating between using the two (in “AJAX”, the X stands for XML).

    Once people started using JSON for data, they never went back to XML.

    Syntax highlighting only works in your editor, and even then it doesn’t help that much if you have a lot of data (like configuration files for large applications). Browsers could even display JSON with syntax highlighting in the browser, for obvious reasons — JSON is vastly simpler and easier to parse.

    • Kissaki@programming.devOP
      link
      fedilink
      English
      arrow-up
      6
      ·
      edit-2
      3 hours ago

      Making XML schemas work was often a hassle. You have a schema ID, and sometimes you can open or load the schema through that URL. Other times, it serves only as an identifier and your tooling/IDE must support ID to local xsd file mappings that you configure.

      Every time it didn’t immediately work, you’d think: Man, why don’t they publish the schema under that public URL.

      • calliope@retrolemmy.com
        link
        fedilink
        arrow-up
        2
        ·
        edit-2
        3 hours ago

        This seriously sounds like a nightmare.

        It’s giving me Eclipse IDE flashbacks where it seemed so complicated to configure I just hoped it didn’t break. There were a lot of those, actually.