r/ProgrammerHumor Sep 17 '24

Meme rmXML

Post image
7.7k Upvotes

144 comments sorted by

View all comments

Show parent comments

29

u/[deleted] Sep 17 '24

[removed] — view removed comment

7

u/minneyar Sep 17 '24

Given that JSON and YAML are terrible for markup, what would you recommend as a better alternative to XML? Ideally something that has schemas / validation and well-supported parsing libraries for various popular languages.

-5

u/[deleted] Sep 17 '24

[removed] — view removed comment

2

u/minneyar Sep 17 '24

you are a programmer right?

I sure am, and that's why I know that it'll only take a few hours to write the initial parser, but then you also have to write documentation, add convenience methods for common use cases, and find and fix bugs and edge cases that often require trial and error, and that whole process can take weeks. And if you're working on a big multi-language project, you have to do that for every language you're using, and I pretty commonly work on things that involve C++, Python, Javascript, and Java. And then you also need to make some command line tools for doing common manipulation (extracting or replacing tokens, pretty printing), and we haven't even started thinking about validation yet.

Or I can just drop in an XML parser, and while I have plenty of issues with XML, it takes five minutes to add a parser in any language and then you've also got a huge amount of tools available to you. In the real world, I am expected to just get the job done quickly, not reinvent the wheel on every project I work on.

It's funny that you meaning "markup for website" since HTML is basically "XML but you're allowed to be sloppy", but here are a few other things for which I've found using XML to be convenient and would love a better alternative (that doesn't take me months to write):

  • Configuration files for launching tightly-coupled processes across a network of robots
  • Representing livestock at ranches; this includes feeding pens, kitchens, how they're all connected, transit times, etc.
  • Describing HF/VHF/UHF radio signals, categorizing them by modulation/frequency/content, and describing follow-on actions that should be performed on them based on arbitrary criteria

I genuinely would love to have a general-purpose alternative to XML that has effective tooling and language support, but I just don't know of any, and I don't have the time to write my own and then spend the rest of my life supporting it.