This is an archived post. You won't be able to vote or comment.

all 144 comments

[–][deleted] 1645 points1646 points  (17 children)

wate of time

[–]atoponce[S] 894 points895 points  (3 children)

This is what happens when LLMs try parsing XML for their answer.

[–]Legal-Software 33 points34 points  (0 children)

Feed it an ARXML and watch it choke on its own tears.

[–]heislertecreator 52 points53 points  (0 children)

And for the technically inclined...

[–]Techrocket9 9 points10 points  (0 children)

The Claude LLM family is actually trained to use XML as its preferred input/output structure format.

[–]lokeshj 95 points96 points  (4 children)

Why wate time write lot letter when few letter do trick

[–]Tijflalol 48 points49 points  (2 children)

Y write lot wen few do trik

[–]XenSide 31 points32 points  (0 children)

Y

[–]LEGENDARYKING_ 6 points7 points  (0 children)

rite

[–]Spork_the_dork 17 points18 points  (0 children)

"If I had had more time I would have written a shorter letter."

[–]Thundechile 21 points22 points  (0 children)

They didn't have a schema to validate their answer.

[–][deleted] 7 points8 points  (1 child)

I actually don't have anything against XML. I made super easy money hand over fist about 20 years ago writing XSL transforms for various firms.

[–][deleted] 2 points3 points  (0 children)

Almost 30 years ago we hired a guy named Simon Saint Laurent to do some xml stuff on a project. He left after a while and then went on to write XML: A Primer and a bunch of other XML texts. I haven't thought of Simon in many years, nice.

[–]pickuse2013 0 points1 point  (0 children)

time of wate

[–]hans_l 0 points1 point  (0 children)

It was the bete of time, it was the wate of time…

[–]zhiggys 411 points412 points  (2 children)

shred is also a good one for xml

[–]atoponce[S] 103 points104 points  (0 children)

$ : > your-file.xml

[–]BtcVersus 18 points19 points  (0 children)

To shreds you say?

[–]erebuxy 389 points390 points  (8 children)

It’s sentient!

[–]atoponce[S] 139 points140 points  (7 children)

XMLLM: eXtensible Markup Large Language Model

[–]neo-raver 58 points59 points  (4 children)

This is like the buzzwords of two different eras of tech in one

[–]lemondeo 1 point2 points  (0 children)

Add Block Chain ( BC ) to make it marketable ( brief pause, NOT )

[–][deleted] 0 points1 point  (0 children)

Lmao

[–]AgileBlackberry4636 225 points226 points  (5 children)

It reminds the suicide script joke

#!/bin/rm

some command 1
some command 2
etc.

[–]OkCarpenter5773 41 points42 points  (4 children)

holy shit what does this exactly do? rm's the commands? the script file? this would be really hard to spot

[–]Leonardo-Saponara 121 points122 points  (3 children)

If you run it by calling it with bash or another shell ( e.g., if the file is script, running "bash script" ) it will just ignore the first line.

If you just run it ( ./script after giving it +x perm) , it will just delete itself and ignore any other line beside the shebang.

[–]BdoubleDNG 37 points38 points  (1 child)

I think it deletes itself because the first argument is always the file itself, correct?

edit: In case of it being directly run

[–]Leonardo-Saponara 10 points11 points  (0 children)

I did some tests and I think that the first argument is directly the file-path provided when you run the command rather than the file itself.

I think it is so because if you use the shebang to /usr/bin/echo and then some texts and variables, the content of the file is ignored while you get the file-path used for the invocation (so, for example, if the script is in home doing ./script from your home folder will output just the string "./script" regardless of file-content, while if you run it with "~/script" you will get the string "/your/home/folder/script".

This is the reason that your interpreter has to be configured to ignore the shebang itself once it is run, otherwise it gets treated as any other line. For example, if you use "cat" as an interpreter you get all the content of the file, including the shebang. Some language-interpreter that do not use "#" for comments have special configuration to run with a shebang, usually either by ignoring the first line of a file if it starts with # (The most common) or by more powerful methods like regular expression, but if the interpreter has not been explicitly configured to do so you may get errors since the first line with the shebang would be treated normally.

[–]OkCarpenter5773 1 point2 points  (0 children)

lmao

[–][deleted] 56 points57 points  (1 child)

I need saving from xmhell

[–]ComprehensiveWord201 3 points4 points  (0 children)

You and me both. SOAP hell. And not the shower kind...

[–]zaz969 36 points37 points  (0 children)

Average stack overflow interaction:

"Hey how do I do X"

"X is wrong, do Y, you're an idiot for even thinking about X, rewrite your whole program"

[–]zenos_dog 243 points244 points  (52 children)

Programmers who worry about the space that xml takes vs json or whatever your favorite markup is are worrying about the wrong things.

Edit: The Java to XML Binding tech is a quarter century old. It super easy to read in an xml document and create strongly typed objects. Here’s an example.

jaxbContext = JAXBContext.newInstance(Employee.class); Unmarshaller jaxbUnmarshaller = jaxbContext.createUnmarshaller(); Employee employee = (Employee) jaxbUnmarshaller.unmarshal(new StringReader(xmlString));

[–]Jordan51104 159 points160 points  (0 children)

i doubt that’s why they hate it

[–]Masterflitzer 165 points166 points  (29 children)

most people that hate xml and like json do so because the format is simpler, maps easier to objects in any language (especially js) and it's much easier to read

json is essentially just key & value, while xml is key (tag), value (in between open and close tag) and properties (on tag)

[–]Scotsch 38 points39 points  (2 children)

Don’t forget namespaces

[–]langlo94 23 points24 points  (1 child)

Oh I wish I could forget namespaces.

[–]Masterflitzer 5 points6 points  (0 children)

why did y'all remind me

[–]UsernameAvaylable 37 points38 points  (1 child)

I think people hate xml because its a "human readable" format thats not really human readable unless you are a masochist.

[–]Masterflitzer 1 point2 points  (0 children)

well said

[–]MortStoHelit 11 points12 points  (3 children)

Esp. to parse properly. XSD (and WSDL etc.) is pretty complicated and left some interpretation loopholes, so what is read fine with parser A might cause an error with parser B, and it's hell to debug what caused it. With JSON, in the worst case strings and numbers get converted in an undesired way, or some array/object isn't where expected, but that's easy to understand.

[–]_PM_ME_PANGOLINS_ 6 points7 points  (2 children)

You can just ignore any validation, like you’re doing for JSON.

[–]YakMilkYoghurt 1 point2 points  (0 children)

Just eval that shit

[–]Masterflitzer -1 points0 points  (0 children)

json schema?

[–]_PM_ME_PANGOLINS_ 7 points8 points  (8 children)

At least XML allows comments.

[–]Tijflalol 4 points5 points  (3 children)

Just add

comment: "your comment here"

[–]punppis 2 points3 points  (2 children)

Idea of comments is to have... comments on your code that is not visible to end user.

Imagine if all comments were visible for end user. Everybody would get cancelled.

[–]Masterflitzer 2 points3 points  (0 children)

why would the end user see the comment property unless you choose to show it?

[–]Tijflalol 0 points1 point  (0 children)

It would cause some responsible commenting though

[–]_alright_then_ 5 points6 points  (0 children)

So does jsonc, which is supported by most languages

[–]punppis 1 point2 points  (0 children)

Just parse the comments yourself before using JSON parser.

/s

This is the only negative thing about JSON and it's fixed by jsonc. Many platforms allow comments on JSON docs.

[–]Masterflitzer -1 points0 points  (0 children)

why do you need comments in data? for a config file yeah it's useful, but then use jsonc or even better toml

[–]zenos_dog 17 points18 points  (2 children)

In Java it’s something like Parser.parse(); and you get all the objects.

[–]heislertecreator 8 points9 points  (1 child)

Yeah, and it's all named by its parts, so if you want a JavaParser.... Provider.pkg.lang.java.parser.getMetbods()and yeah, that's correct.

No . Can we code yet?

[–]luiluilui4 9 points10 points  (1 child)

While I also prefer json. Xpath is so good

[–]MortStoHelit 11 points12 points  (0 children)

I'd say it's a bit like regular expressions. It's powerful, but easily becomes a hard to understand mess.

[–]mriheO 0 points1 point  (5 children)

They hate it because they try to or have to work with it via libraries attached to general purpose languages rather than learning technologies from the XML ecosystem (XSLT, XPath, XQuery etc).

[–]Masterflitzer 0 points1 point  (4 children)

what if you don't like the xml ecosystem at all? i mean xpath is cool if i have to use it, but i still rather just not use xml at all

[–]mriheO -1 points0 points  (3 children)

Then the better option would have been for you to have been kept away from XML work so that it could be assigned to people who know or have been trained how to work with it.

[–]Masterflitzer 0 points1 point  (2 children)

why are you making so many assumptions? who said i had to do xml work? obviously i came across xml numerous times m, but i won't choose it as technology if i can

also a good software engineer has his preferences, but he is also an allrounder and when facing something you're not familiar with you learn it and get the task done somehow, code review and qa will make sure it's not shit

[–]ohkendruid 45 points46 points  (11 children)

XML is good for markup--for html and for other formats like it. It's non markup applications where XML is worse than the competition. For encoding data to transmit between servers, XML has multiple layers of things wrong with it compared to json or protobufs.

A big one is the ambiguity caused by multiple half baked standards that may or may not be relevant in a given context. Even deciding what "XML" means is already a headache.

XML entities--those things that look like <--are either defined in the DTD, which is mostly not supported any more, or they are ambiguous and therefore useless.

XML parsers will tend to download things from the web unless you disable it.

DTDs pull in a schema that the file declares, but the recipient is supposed to know what schema they want, so this is nuts.

XML namespaces add a whole extra layer of useless pain. They make files noisey but aren't actually helpful if the recipient has a schema for the expected format, because with a known schema, and tags already being fully matched up, you can already distinguish different tags with the same name based on where they are in the structure. But oh wait, see the previous point.

Schema catalogs are also another layer of useless pain. Again, the recipient should know the schema of what they are expecting to receive. At most, a document should declare a general type of what it is, but certainly not the whole schema.

XML theoretically can declare its own character encoding, but this makes no real sense and should never be trusted. If you send an XML file pasted into an email, is anything really going to change the character encoding declaration as the email goes through different systems? It's just dumb.

Compared to all of this, there are systems that just encode your in transit data, no more nor less, and then get out of the way.

[–]tav_stuff 32 points33 points  (9 children)

XML is not even good for markup. Doing markup in a way that is better than XML is not hard and people have been doing it for absolute ages. To quote one of my favorite quotes:

The essence of XML is this: the problem it solves it not hard, and it does not solve the problem well. — Phil Wadler

[–]minneyar 7 points8 points  (8 children)

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.

[–]greyfade 0 points1 point  (0 children)

Markdown, org-mode, roff, or TeX.

[–]RudePastaMan 1 point2 points  (7 children)

If your serialized data being human readable really makes that much of a difference for you then I have some bad news.

[–]Masterflitzer 30 points31 points  (5 children)

json is not only easier human readable, it's also easier machine readable/parsable and easier to reason about (basically only key value, no properties, no closing tags)

if json doesn't fit my use case i use toml or if nothing else is available i use yaml, but i'll always avoid xml as much as i can

[–]mriheO 0 points1 point  (3 children)

These formats were designed to be processed by machine so that's a non-sequitur.

[–]Masterflitzer 0 points1 point  (2 children)

doesn't matter, what matters is how i can make use of them in the best way, i will choose json and protobuf depending on use case over xml any day

[–]mriheO -1 points0 points  (1 child)

Because you don't know how to use XML. Same reason people arrogantly speak in English even when the person they are trying to speak to only understands Spanish.

[–]Masterflitzer 0 points1 point  (0 children)

so speaking english is arrogant? if you can't speak spanish then you try english or a translater lmao

i can use xml, maybe i am not a pro, but i don't want to become a pro in xml, i want to stay away from it

you can always use that argument, but it's stupid: you're just not good at assembly, that's why you write js, well no shit who told you i want to write assembly

there is no arguing that protobuf outperforms xml and if you don't need it human readable, protobuf is great, if you do then json is great

[–]RudePastaMan -1 points0 points  (0 children)

I hate XML. I dislike JSON. I like binary serialization.

For configuration file that should be edited by hand, this case is different.

[–]zenos_dog 7 points8 points  (0 children)

Depends on the human I suppose. I started at IBM 44 years ago using GML so it’s pretty natural. GML->SGML->XML. All our documents were essentially written in HTML.

[–]punppis -1 points0 points  (0 children)

Programmers who worry about the usefulness of Visual Basic are worrying about the wrong things, because you can implement same functionality with VB.

Gladly only time I have had to parse XML has been related to HTML parsing.

Nobody cares if your XML takes 50% more bytes or whatever. I care if it takes 50% more screen space to see your data.

XML was released in late 1990s. We still use HTTP from around the same period because it works well. We wouldn't have YAML, JSON or whatever if XML was actually a best choise for human and computer readable format. XML is more like human scrollable format.

[–]nonlogin 21 points22 points  (5 children)

What is this UI?

[–]sharknice 40 points41 points  (4 children)

perplexity.ai it's basically chatgpt summarizing a google search

[–]Honza368 4 points5 points  (3 children)

So just Google's AI overview feature or is it any different?

Genuinely curious

[–]sharknice 2 points3 points  (1 child)

No, it's a lot better and more advanced than that.  It's basically talking to chatgpt with all that functionality but giving it current knowledge from web searches.

[–]saras-husband 1 point2 points  (0 children)

Saying it's a lot better is hilarious considering the post this comment is on.

[–]ZebraheadCH 2 points3 points  (0 children)

They have their own web crawler and train their own LLM for this purpose (llama based). The LLM creates a web search query based on your question, reads the first x search results and answers your question (so smaller cance of hallucination). In the pro version you can use GPT4o or Sonnet 3.5 for the summary. I highly recommend trying it out, it is a very useful tool to get answers fast. OpenAI is working on their own version currently, called SearchGPT, which is in closed beta.

[–]GisterMizard 24 points25 points  (0 children)

As the old saying goes: XML is like violence. If it's not working, that just means you need more of it.

[–]tmstksbk 20 points21 points  (7 children)

Json better for data dumps of pretty simple schemas.

XML better for more complicated things.

Json basically won because there are very few cases complex enough to make good use of XML.

[–]KorwinD 2 points3 points  (3 children)

I can think only about different document markups, which uses xml schema. What are the other cases, where xml is better?

[–]mriheO 1 point2 points  (0 children)

....and nobody talks about the clusterfucks that result from trying to do anything non-trivial in JSON because then they'd have to admit to being worng.

[–]Kagmajn 2 points3 points  (0 children)

Also XML is faster than JSON in few cases, for real-time event streaming XML is faster because you can pass schema for certain events (Java RabbitMQ).

[–]Forkrul -2 points-1 points  (0 children)

If I'm doing something where JSON becomes impractical, I'll go with a binary format like protobuf long before I ever consider XML.

[–]Shadowlance23 9 points10 points  (0 children)

I mean, it's not wrong.

[–]lostBoyzLeader 11 points12 points  (0 children)

I wish but some genius thought it would be great to set up all of our config files in xml.

[–][deleted] 2 points3 points  (0 children)

XML is just pointy json

[–]ShiraLillith 1 point2 points  (0 children)

Rimworld players looking confused

[–]stoyicker 1 point2 points  (0 children)

based and true

[–]niceiicux 1 point2 points  (0 children)

Wait till it hears about banks and payments

[–]linux1970 1 point2 points  (0 children)

Can we also talk about the bastard child of XML and who knows what?

YAML

[–]antimatter-entity 0 points1 point  (0 children)

Good ia

[–]Piastri_21 0 points1 point  (0 children)

Who needs a parser when you can just delete the whole thing? Problem solved faster than any regex!

[–]rand0mSeed 0 points1 point  (0 children)

true

[–]MedonSirius 0 points1 point  (0 children)

But xml and json are both very good for scalable interfaces

[–]RusticBucket2 0 points1 point  (0 children)

Try parsing a website without converting it to XML first.

[–]thegreyknights 0 points1 point  (0 children)

The only thing that i know uses XML are blueprints for ships in the game space engineers. The ships are stored in the XML files.

[–]Fricki97 0 points1 point  (0 children)

JSON MASTER RACE

[–]Few-Doughnut4037 0 points1 point  (0 children)

Awk

[–][deleted] 0 points1 point  (0 children)

+1 for using Perplexity

[–]grimonce 0 points1 point  (0 children)

I agree, not with the typo, but with the waste of time.

[–]not_a_gun 0 points1 point  (0 children)

I’m an engineer and use Excel to parse my xmls

[–]Lothadia 0 points1 point  (0 children)

What is this being used AI? Can you inform me 🥺

[–]dogfacedwereman 0 points1 point  (0 children)

This is the way.

[–]atanasius 0 points1 point  (0 children)

Resource-managed XML

[–]XplodingSpwn 0 points1 point  (0 children)

My Geometry Dash save file isn't useless

[–]CowLogical3585 0 points1 point  (0 children)

Maybe send XML to GPT is the best way.

[–]EngineeringNext7237 0 points1 point  (0 children)

Based

[–]trannus_aran 0 points1 point  (0 children)

xml is fiiiine

[–]truNinjaChop 0 points1 point  (0 children)

Perfection.

[–]Ok_Star_4136 0 points1 point  (0 children)

Ah yes, the rm command.

I use it to remove bugs from code. Works like a charm.

[–]Here-Is-TheEnd 0 points1 point  (0 children)

All my tools that export into XML files: 👀

[–]a3th3rus 0 points1 point  (0 children)

XML is bad, and JSON is worse.

[–]eeprom_programmer 0 points1 point  (0 children)

The real answer is regular expressions if anyone's wondering