Hacker News new | ask | show | jobs
by hoseja 2113 days ago
I never had to work with it seriously but I still don't get why people hate XML so much.
5 comments

XML is verbose, surprisingly complex, and first and foremost not designed to be written and consumed by humans.

There's plenty of room for debate, e.g. element versus attribute and things get unwieldy pretty quickly [1]

The "note"-example illustrates the issue quite well: the order of the elements matters and you end up writing every element identifier twice.

Not to mention the bloat that comes with using an XML library that's actually compliant with the standard and includes all the bells 'n whistles.

[1] https://www.w3schools.com/XML/xml_dtd_el_vs_attr.asp

I would venture a guess that on the surface, it's about its verbosity and the pyramids of doom you can get when editing.

On a deeper level, I think they might be frustrated with the ability to develop custom formats (XSDs) which effectively make XML not one format, but a gazillion formats.

I think it allows too much and parsing it becomes a burden.

with json - you just suck it all into your data structure

with xml - sometimes people put stuff as a tag, sometimes as an attribute. Maybe not you, but someone else will do it.

Hipster meme that only xml has problems. Ironically they now went full circle to yaml, which is much more obtuse than xml.
Personally I find it a lot less readable than things like JSON or TOML.