9 ms·
There numerous problems with YAML. It is underdefined, ambiguous, fragile, and is just impossible to write a portable parser for. JSON is naive, lacks almost e
by vkazanov 19d ago
There numerous problems with YAML. It is underdefined, ambiguous, fragile, and is just impossible to write a portable parser for.
JSON is naive, lacks almost everything. But is supereasy to parse and read.
As funny as it sounds, XML is overspecified. Parsing is possible and predictable but supporting the full standard (all of them) is so much work that nobody does it anyway.
So, given the choice above, i'd go for naive simplicity.
- DanielHB 19d agoThere is a subset of yaml which is like 99.9% of all yaml code that is fine. And then you have whatever the hell OpenAPI uses.
- vkazanov 19d agoYes, true, there is this legendary subset... but parsing even a sane subset of the spec is a nightmare for all parties involved.
- preg_match 19d agoXML being overspec'd is good, IMO, because we get things like xpath, XLSX, schemas, etc very easily. It would be fine if people just use libraries for these. I mean, I certainly wouldn't roll a JSON parser by hand either, even if it is easier. XML just looks nasty, but IMO not worse than JSON. JSON is not easy to read, because brackets suck for deep nesting. XML nesting is 100x easier to read, because the closing tags tell you exactly what is closing.
- vkazanov 18d agoSure, a careful spec is always great. In xml's they clearly overdid it. all the formats/substandards you listed... there is just not a single library that supports all of the standard. And because implementations are so different, most users just stick to a single C library. That library, btw, is also incomplete and undermaintained. So that's the problem with complex standards: they are hard to implement and support. Nobody does this, unless it is a business-critical matter.