• state_electrician@discuss.tchncs.de
    link
    fedilink
    arrow-up
    3
    ·
    10 days ago

    I am so old that I worked with SGML. Compared to that, XML is a lovely language. And sometimes I still miss writing XSLT to quickly transform some XML documents. These days you can do similar things with JSON, of course. But it’s not as easy and standardized as the XML tooling.

  • blackstrat@lemmy.fwgx.uk
    link
    fedilink
    arrow-up
    4
    arrow-down
    2
    ·
    10 days ago

    XML is a superior format to Json or yaml or any of those other trendy formats around today. It’s the hill I’m willing to die on because I’m right.

    • anyhow2503@lemmy.world
      link
      fedilink
      arrow-up
      10
      ·
      10 days ago

      XML aims to be both human-readable and machine-readable, but manages neither. It’s only really worth it if you actually need the complexity or extensibility, otherwise it’s just a major pain to map XML structures to any sensible type representation. I’ve been forced to work with some of the protocols that people like to present as examples of good XML usage and I hate every single one of them.

      Fuck YAML though. That spec is longer and more complex than any other markup language I know of and it doesn’t have a single fully compliant implementation.

      • corroded@lemmy.world
        link
        fedilink
        arrow-up
        2
        ·
        10 days ago

        I’m okay with the “human-readability,” but I’ve never been happy with the “machine-readibility” of XML. Usually I just want to pull a few values from an API return, yet every XML library assumes I want the entire file in a data structure that I can iterate through. It’s a waste of resources and a pain in the ass.

        Even though it’s not the “right” way, most of the time I just use regex to grab whatever exists between an opening and closing tag. If I’m saving/loading data from my own software, I just use a serialization library.

      • GTG3000@programming.dev
        link
        fedilink
        arrow-up
        0
        arrow-down
        1
        ·
        8 days ago

        Yeah, I remember when I was trying to parse XML into some lua tables and it forever stumped me how to represent something like

        <thing important_param=10 other_param="abracadabra"> stuff </thing>
        

        You just have to have different ways to turn different tags into stuff in your program and that’s a huge amount of overhead to think about when all I want is a hash map and maybe an array.

      • key@lemmy.keychat.org
        link
        fedilink
        English
        arrow-up
        1
        ·
        10 days ago

        Something being “old” is totally unrelated to whether it’s trendy. See: virtually every food and fashion trend.

    • Moldy@lemmy.zip
      link
      fedilink
      English
      arrow-up
      1
      ·
      edit-2
      8 days ago

      Nah, XML is just a slightly older fad. Let’s go back to S Expressions. They’ve been in use for over 60 years and have significantly better readability.

    • redfellow@sopuli.xyz
      link
      fedilink
      arrow-up
      1
      ·
      9 days ago

      As someone who works with both, readability is the utmost important thing for me, and XML is cumbersome and has more characters to sift through to find what I’m lookin for.

    • RonSijm@programming.dev
      link
      fedilink
      arrow-up
      1
      ·
      10 days ago

      Uh-huh… ever tried to integrate with a poorly implement WCF service? Like communication from a Java service to a dotnet service through a WSDL?

      I’ll take a json API over XML any day

      • Sphks@lemmy.dbzer0.com
        link
        fedilink
        arrow-up
        0
        ·
        10 days ago

        From my point of view : it has a hudge ecosystem with tons of robust libraries. This does not make it perfect, but for an industrial point of view, you don’t look for new shiny clean things. (My point of view is 15 years old yet…)

        • magic_lobster_party@fedia.io
          link
          fedilink
          arrow-up
          1
          ·
          10 days ago

          I think JSON is more robust than XML by now. Mostly due to its simplicity. There are few reasons why anyone would pick XML over JSON these days.