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…
There 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.
That's a Lot of YAML
41–50 of 78 posts
Re: That's a Lot of YAML
#42It’s because ppl are not using it correctly, it was designed for configs and now it’s being used as a programming language… a language without types and debugger. It’s frustrating devs because they find the issue at the deployment time, not the compile time. Personally I did never pick the YAML as a first format for the configs, only my ruby friends did that.
Re: That's a Lot of YAML
#43chuckle 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
I read that as libfuckyaml
Re: That's a Lot of YAML
#44I won't even look at it, and it will be just fine.
Re: That's a Lot of YAML
#45Unlike hjson, toml and many others, JSON5 didn't try to reinvent the wheel and create a totally new syntax.
Instead, they took 2 already well established standards (JSON and ECMAScript 5.1) and put them together.
I think that it is pleasant enough to write by hand while not creating yet another new syntax that you have to get used to.
Re: That's a Lot of YAML
#46I actually like the SQL example.
right? Sensible nesting (that's how I'd break and indent a long query anyway), folding in proper code editors, proper hierarchy... what's not to like?
(select (num name)
:from customers
:where (exists (select name
:from orders
:where (and (= customers.num
orders.customer_num)
(Re: That's a Lot of YAML
#47There 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.
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?
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: https://en.wikipedia.org/wiki/Superset
See also the comment below: https://news.ycombinator.com/item?id=49476489
Offtopic note: I wanted to dig the wiki superset link up the lazy way, so searched for superset, and all I got was endless list of marketing trash links. Even on DDG. RIP, we are on the Dead Internet.
Re: That's a Lot of YAML
#48Next time the author would like to write an article like that, it’s better that they offer a new standard that is as flexible while also doing the work YAML is doing today
Re: That's a Lot of YAML
#49There 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.
I also wonder why it’s the 2012 version of the language which gets all the hate, instead of the hate being directed at Google, who doesn’t care about putting resources towards updating the main offender, Kubernetes’ YAML 1.1 parser. https://github.com/kubernetes/kubernetes/issues/34146#issuec...