• somePotato
    link
    fedilink
    arrow-up
    54
    arrow-down
    2
    ·
    edit-2
    11 months ago

    I was disgusted by the XML at first, but it’s a readable query returning a sane JSON object.

    Meanwhile, I’m mantaining Java code where the SQL is a perfectly square wall of text, and some insane mofo decided the way to read the resulting list of Object[] 🤮 is getting each column by index… so I’d switch to SQXMLL in a heartbeat.

    • cmdrkeen@programming.dev
      link
      fedilink
      arrow-up
      23
      arrow-down
      1
      ·
      11 months ago

      React basically figured out how to make XML work.

      Remember, XML was actually designed for use cases like this, that’s why it came with XPath and XSLT, which let you make it executable in a sense by performing arbitrary transformations on an XML tree.

      Back in the day, at my first coding job, we had an entire program that had a massive data model encoded in XML, and we used a bunch of XSL to programmatically convert that into Java objects, SQL queries, and HTML forms. Actually worked fairly well, except of course that XSL was an awful language to do that all in.

      React simply figured out how to use JavaScript as the transformation language instead.

    • leftzero@lemmynsfw.com
      link
      fedilink
      arrow-up
      4
      arrow-down
      1
      ·
      11 months ago

      it’s a readable query returning a sane JSON object.

      No it’s not. What table is the data supposed to be coming from…?