News for hackers. Stuff that matters.
Re:No YAML by woodruffw on Wednesday October 27, 2021 @09:36PM (#29021304)
For all of its warts, YAML hits the sweet spot between readability, writability, commentability, and (mostly) intuitive syntax. It's easy to serialize complex objects to, and comes bundled with Ruby's runtime.

There are a lot of valid complaints about YAML, but I still reach for it when I really only need a barebones configuration file.

Re:No YAML by smt88 on Wednesday October 27, 2021 @10:00PM (#29021470)
> For all of its warts, YAML hits the sweet spot between readability, writability, commentability, and (mostly) intuitive syntax.

Could not disagree more strongly and it seems many others in software agree, based on this comment section and the original article.

> It's easy to serialize complex objects to, and comes bundled with Ruby's runtime.

I don't know that Ruby support is why it's widely adopted. Ruby is common in some spaces, but not a wildly popular language at all.

I honestly think some popular project (maybe Docker Compose or something from HashiCorp?) used it for a config file and then everyone else started doing it too.

Re:No YAML by woodruffw on Wednesday October 27, 2021 @10:30PM (#29021655)
> Could not disagree more strongly and it seems many others in software agree, based on this comment section and the original article.

They sure do! But lots of people also agree, as evidenced by people continuing to use it. The world keeps turning, and we engineers keep using suboptimal things.

> I don't know that Ruby support is why it's widely adopted. Ruby is common in some spaces, but not a wildly popular language at all.

Ruby’s now gone out of fashion, but it was the most popular web development language (especially among startups) for the better part of a decade. It’s conjecture, but I wouldn’t be remotely surprised if Ruby brought YAML into a lot of shops by virtue of bundling it. Docker (and Docker Compose) came into full force a few years into Ruby’s peak, so it’s the egg to Ruby’s chicken. And we’ve all forgotten that Hashicorp was originally a Ruby shop!

Re:No YAML by emodendroket on Thursday October 28, 2021 @12:14AM (#29022303)
> I honestly think some popular project (maybe Docker Compose or something from HashiCorp?) used it for a config file and then everyone else started doing it too.

Kubernetes maybe? It also supports JSON but JSON is less friendly to manual editing and source control IMO.

Anyway, sure, a lot of people in software disagree. For almost any opinion you might have, you could find many to agree, and many to disagree.

Re:No YAML by atoko on Wednesday October 27, 2021 @10:27PM (#29021635)
I would bet on the source probably being gitlab-ci configurations
Re:No YAML by woodruffw on Wednesday October 27, 2021 @10:34PM (#29021685)
Travis CI predates Gitlab CI by several years, and uses YAML. Definitely a big source of peoples’ YAML experiences these days, but not one of the original ones.
Re:No YAML by geerlingguy on Wednesday October 27, 2021 @10:15PM (#29021555)
If you've ever tried managing complex, human-centric configuration in JSON, XML, ini, or most any other format, you realize it ticks a lot of the checkboxes that are necessary for a good human-readable configuration format:

Requires some amount of legibility out of the box due to whitespace requirements.

Can store complex data structures (and even direct JSON).

Allows comments.

Re:No YAML by emodendroket on Thursday October 28, 2021 @12:14AM (#29022310)
Hand-writing escaped JSON is an exercise in frustration, unlike YAML. Another point in its favor.
Re:No YAML by lamontcg on Thursday October 28, 2021 @12:16AM (#29022327)
> Requires some amount of legibility out of the box due to whitespace requirements.

which makes it terrible due to semantic whitespace rules.

parsers shouldn't care about legible whitespace

linters should care about legible whitespace

Re:No YAML by api on Thursday October 28, 2021 @08:01AM (#29025033)
> comes bundled with Ruby's runtime.

It comes bundled with something. Question answered.

TOML may get more popular due to Rust.

Re:No YAML by woodruffw on Thursday October 28, 2021 @09:23AM (#29025807)
I like TOML a lot, but it still misses a few of the checkboxes: it’s not actually bundled with Rust, and the table syntax is pretty unintuitive (IMO) compared to YAML’s array-of-dictionary syntax.