3 ms·
Looked at the sibling comments. Has everybody collectively forgotten that XML exists? This stuff was solved decades ago, XSDs can check types. TOML nesting is
by RadiozRadioz 2y ago
Looked at the sibling comments. Has everybody collectively forgotten that XML exists? This stuff was solved decades ago, XSDs can check types.
TOML nesting is indeed a joke. YAML & JSON "look clean", but try to match up nesting in a large document without help from text editor highlights, then see how easy it is in XML.
XML has universal support everywhere, has first-class tooling for everything that's being re-invented in these other languages, but it's not "cool" any more.
- steelbrain 2y agoMaybe you have worked with a different XML than I but I have only terrible memories of working with XML. Starting from the parser inconsistencies (that even led to security vulnerabilities in Apple, see https://blog.siguza.net/psychicpaper/ https://blog.siguza.net/psychicpaper/). On a higher level, the fact that so much different kind of information could exist at each level was nothing but headaches. In YAML, or in JSON, it's pretty straight forward. You have an object, it has children, children have types/values etc. In XML, you have to keep in mind what the tag of the element, what its attributes are, and then what the child elements are, and then whatever the heck CDATA is. I think my fellow posters are looking at the past through nostalgic rose tinted glasses. XML was terrible and I am glad it's not used as widely anymore.
- kdjdjsj 2y agoI too really don't get the hate for XML Features like schema feel very natural in XML whereas JSON schema feels outer worldly; and is seldomly used Being able to clearly distinguish between multiple semantically different types of strings is a blessing And coming back to your example, how is the knowledge in JSON of which attribute is an array, which is an object, which is a string and when order of attributes as well as duplicates matter and when not any easier than XML?
- xelamonster 2y agoMy two biggest issues: 1. No consistency in whether a value is an attribute or a child element, they seem completely interchangeable and redundant. I'm sure there's some nuance I'm missing here but I've worked with my fair share of XML and it has yet to be relevant to me at least. This adds a lot of mostly arbitrary decisions to the design phase, makes it difficult to clearly refer to specific values, and means it's impossible to directly parse XML into an object structure in most languages like you can with JSON. 2. It's awful to read and write. Everything is just a mess of tags and any structure is quickly lost. Line splitting is awkward and often not even attempted (seriously I had coworkers push back when I applied basic formatting to a config file because they claimed it was easier to read with lines 3x the width of anyone's screen). Needing to name the object in both the opening and closing tag wastes space and is absolutely ridiculous when writing by hand (sure editors can kinda handle this now but not perfectly and sometimes I'm using vi over SSH because that's all there is). I really don't understand why so many people are still so attached to it myself.
- immibis 2y agoXML is a great generic framework for markup languages. When you aren't doing markup, XML is terrible. However, JSON fits the role. The opposite problem exists in Minecraft chat message formatting - they used JSON for markup, when it should have been XML.
- indrora 2y agoAs someone who previously worked in an XML-heavy environment, I would rather have an NFL linebacker dropkick me in the head than deal with XML again. Tim Bray himself has had doubts [1] at one point. XML is too big of a hammer for the space it fills. [1] https://www.tbray.org/ongoing/When/200x/2003/03/16/XML-Prog https://www.tbray.org/ongoing/When/200x/2003/03/16/XML-Prog
- some_random 2y agoIt's not "cool" anymore because it's painful to work with despite all the tooling and support
- kelnos 2y ago> It's not "cool" anymore because it's painful to work with That's kinda weird way to phrase it; being painful to work with has nothing to do with "coolness"... that's a legitimate complaint. Despite all the tooling and support, XML is painful to work with.
- xelamonster 2y agoI think they agree with you and meant that sarcastically.