Hacker News new | ask | show | jobs
by hot_gril 1523 days ago
> xml is meant to be read by computers, not humans.

Online sources say it's meant to be both human and machine readable. It would be less bloated if it were just for machines. Seems like a generalization of HTML, which is meant to be hand-crafted in some cases.

Even if it were for machines only, it'd still need a human-friendly way to manipulate and debug with, and there isn't one. Protocol buffers have the text version for humans and the serialized binary for machines, plus the generated getters/setters for code. XML is a pain to deal with no matter how you abstract it.

JSON with namespaces would just mean another key-value pair in the dict or something. But I'm not sure why that's needed anyway.

> It's 2022 and there is still nothing better for federated messaging.

True, but federated messaging isn't in style anymore, and honestly I hardly even used XMPP. Was working on my own protocol 2 years ago that I truly believed was the best, and had a working reference impl, but had to abandon it. Got 2 jobs already.

1 comments

Unless your XMPP client is a human, XML in your XMPP connection is meant to be read by a computer.

I work with XMPP for many years and approximately zero problems we face would be solved by switching to JSON or whatever.

This "JSON is better than XML" is a modern version of old religious debates like Gnome vs KDE, Pascal vs C, Christianity vs Islam.

Only if you switch to JSON the way they describe in the joke XEP https://xmpp.org/extensions/xep-0295.html where they force XML into JSON form instead of properly redesigning the messages.

I think most people agree that XMPP messages are hard to read during debugging, and this is somehow not a problem in any of the JSON-based protocols.

No. Please, stop it.

XML is not a problem. Parsing it is not a problem. Reading it is not a problem, too. None of the problems ever faced by us in the development of XMPP software would have been solved if it was switched from XML to JSON, nor made even a slightly easier to solve.

Literally half the OP article along with half the comments here explain how XML is a problem, how it is not equivalent to any other serialization format, etc. IMO the funniest example is stanza ids. That problem wouldn't exist even if they just used said XML in a remotely sane manner. But they really wanted to go all in on it. It's the XML mindset, the need to complicate things.