Live data from Hacker News

That's a Lot of YAML

noyaml.com

71–78 of 78 posts

Re: That's a Lot of YAML

#71

There is no problem with YAML, just like there was no problem with XML at all. The problem is with the software devs who use it for the wrong thing. I just wonder why JSON doesn't get all the hate, while it is a terrible format also: it is not streamable (YAML is), it doesn't have comments... and non-standard workarounds are used for these features. Norway better than YAML, in my opinion.

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 nai…

XML 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.

Re: That's a Lot of YAML

#72

Earlier quoted context omitted.

> I just wonder why JSON doesn't get all the hate, while it is a terrible format also: […] it doesn't have comments […] The lack of comments in JSON is not a bug; comments in JSON were an anti-feature. Douglas Crockford intentionally removed them to prevent developers from using comments to store parsing directives (which he saw people doing in earlier revisions). * https://web.archive.org/web/20120507093915/https://…

I'd say that only really strengthens OP's overall point of being about using "the wrong language for the wrong thing".

Yes: JSON was meant to be a machine-to-machine format, and it's the humans that are insisting on comments.

Re: That's a Lot of YAML

#74

Earlier quoted context omitted.

I'd say that only really strengthens OP's overall point of being about using "the wrong language for the wrong thing".

Yes: JSON was meant to be a machine-to-machine format, and it's the humans that are insisting on comments.

JSON was also meant to be read and edited by people, as was all web technology, and people have a use for comments.

Even Douglas Crockford suggested that people could still use comments, as long as they strip them out before parsing.

Re: That's a Lot of YAML

#76
post #15

chuckle Well most of that is due to 1.1 which has been deprecated god knows for how long. 1.2 does not have the 'Norway' problem any more. Tooting my own horn, this is how a modern YAML library looks like nowadays: https://github.com/pantoniou/libfyaml

> NI: Nicaragua

Oh, what sad times are these when passing ruffians can say Nicaragua at will to old ladies! There is a pestilence upon this land, nothing is sacred!

Re: That's a Lot of YAML

#77

Earlier quoted context omitted.

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 nai…

XML 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 tag…

Sure, 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.

Re: That's a Lot of YAML

#78
post #26

Earlier quoted context omitted.

YAML is (or at least, is declared by its maintainers to be) a superset of JSON, making any JSON document also a valid YAML document. So surely if YAML is streamable, JSON must be too? Or are the YAML maintainers incorrect?

> YAML is (or at least, is declared by its maintainers to be) a superset of JSON, making any JSON document also a valid YAML document. > So surely if YAML is streamable, JSON must be too? Given YAML is not a subset, but a superset of JSON, as you correctly noted, I'm not sure how you reached that conclusion. > Or are the YAML maintainers incorrect? I think you should check this page before making snarky comments: htt…

> snarky comments

How was my comment snarky? The YAML maintainers may have intended YAML to be a superset of JSON, but failed by not incorporating some obscure feature of it that bore on whether it was streamable or not.

Post reply on HN