4 ms·
Any ML can have schemas and JSON does, I don’t know what you’re talking about. What you describe is all just about support from tools, which JSON has plenty now
by cunthorpe 5y ago
Any ML can have schemas and JSON does, I don’t know what you’re talking about. What you describe is all just about support from tools, which JSON has plenty now.
The advantage that a ML can have over another is how easy it is to:
- parse by the machine
- read and edit by humans
Also useful but less so:
- esoteric features like cyclic dependencies
- size
- Ygg2 5y agoYeah, but Yaml and to some extent JSON tooling just shrivel compared to XML. I had to edit Liquibase configs in YAML and XML. YAML was a fucking nightmare.
- pydry 5y agoXML tooling is fucking horrible. I still get flashbacks to maintaining XSLT sometimes. It was a tool that didnt really need to exist and arguably did more harm than good by being "recommended". I remember very clearly that although XML had tooling for schema validation it was awful and people tended not to get beyond the "DTD vs XSD" debate before giving up on it. Both of them sucked. Then there's XPath. Why XPath? Because if your markup language doesnt map to normal programming data structures you need a band aid to fix it. As for SOAP.... that can die in the fiery pits of hell with XMLSpy.
- Ygg2 5y agoI said tooling was superior, not XML tooling was a silver bullet. DTD is mostly just an attack vector. XSD or Relax NG are both solid. XQuery was kinda useful but XML people went too far and started adding shit that it doesn't belong to it. XSLT like has one or two credible use cases, like replacing entity expansion from DTD. Rest of it was just like XML database doomed from the start. SOAP. I never saw it actually being used.
- pydry 5y agoSuperior to what, though? Most of this tooling has equivalents that are barely used because they didnt really need to exist in the first place (e.g. XSLT) or were a band aid over problems with XML itself (XPath / XMLSpy). That leaves JSON schema, which - still more pleasant than XSD or DTD.
- TedDoesntTalk 5y agoI worked on a website that generated all HTML through XML data with XSLT templates. It was possibly the worst experience of my career.
- kaba0 5y ago> Why XPath? Because if your markup language doesnt map to normal programming data structures you need a band aid to fix it. How do you express easily “every element that has X in its path” with a programming language? Of course you can write such a program but it is similar to regex - you could write a FSM but it is much easier to use a DSL for that.
- tored 5y agoJSON schemas are horrible though. Every implementation I tried didn't fully respect the entirety of the JSON schema specification. JSON schemas are by default non-strict, which is the opposite what you want.