Live data from Hacker News

YAML: probably not so great after all (2017)

arp242.net

11–20 of 412 posts

Re: YAML: probably not so great after all (2017)

#11
post #2

We've spent like 10 years trying to fill in gaps left when we all decided to hate XML. JSON is great as a lightweight DIF between trusted partners. If you care about maintenance and safety, XML with XSD is rock solid.

To be quite honest I dislike using XML for human editable configuration files. Variations on Microsoft's .ini files (such as TOML) seem to work best for that, IMHO.

Re: YAML: probably not so great after all (2017)

#12
post #8
post #2

We've spent like 10 years trying to fill in gaps left when we all decided to hate XML. JSON is great as a lightweight DIF between trusted partners. If you care about maintenance and safety, XML with XSD is rock solid.

XML is in that odd middle-ground where it's usually human-readable, but also a huge pain in the ass to write. It's great at what it was intended for, as a data interchange format. For a general-purpose human-writable structured data format, I guess the ugly nonstandard hack that is "JSON with comments" is probably good. It's certainly faster to parse than YAML.

I've managed to teach non-programmers to successfully edit YAML files without too much trouble, but most non-programmers have a really hard time consistently producing valid JSON by hand.

As much as there is a lot to not like about YAML, it is the easiest one for humans to consistently write in my experience.

Re: YAML: probably not so great after all (2017)

#13
post #2

We've spent like 10 years trying to fill in gaps left when we all decided to hate XML. JSON is great as a lightweight DIF between trusted partners. If you care about maintenance and safety, XML with XSD is rock solid.

Safety? Sounds like rosy retrospection to me. We're still dealing with XML vulnerabilities.

Re: YAML: probably not so great after all (2017)

#14
post #2

We've spent like 10 years trying to fill in gaps left when we all decided to hate XML. JSON is great as a lightweight DIF between trusted partners. If you care about maintenance and safety, XML with XSD is rock solid.

Especially when technologies like E4X came out to make writing and reading XML in JS so much easier. Although I don't miss SOAP at all.

Re: YAML: probably not so great after all (2017)

#15
I'm gonna continue using YAML, like, even if each parser came with support for a halt-and-catch-fire directive that you couldn't turn off or whatever. It's just about the only markup language where you can embed multiline strings without the indentation being fucked either in the markup or in the resulting string, without requiring lots of escaping.

Re: YAML: probably not so great after all (2017)

#17
post #10
post #2

We've spent like 10 years trying to fill in gaps left when we all decided to hate XML. JSON is great as a lightweight DIF between trusted partners. If you care about maintenance and safety, XML with XSD is rock solid.

What is a DIF?

"data interchange format"

Re: YAML: probably not so great after all (2017)

#18
post #9
post #2

We've spent like 10 years trying to fill in gaps left when we all decided to hate XML. JSON is great as a lightweight DIF between trusted partners. If you care about maintenance and safety, XML with XSD is rock solid.

My biggest complaint with JSON is the lack of support for comments. For that reason, it's hard to take it seriously for human-maintained configurations.

I got hit by lack of comment support in go-yaml recently.

https://github.com/go-yaml/yaml/issues/132

Re: YAML: probably not so great after all (2017)

#19
post #5

I agree with some of the author's points but the "surprising behaviour" section is odd. For example, why would you expect `3.5.3` to be parsed as a number? How could that be parsed as a number?

I think the author's point is that when juxtaposing 3.5.3 and 9.3, it's easy to overlook that they'll be parsed as different types.

Re: YAML: probably not so great after all (2017)

#20
post #6

With YAML I can never remember what's an object versus a list, string, or number, nor am I ever able to add new stuff to a YAML file and get it to parse correctly without first looking up the spec. And it's impossible to see where large objects start and end. In contrast, JSON is super intuitive and basically self documenting. The only real quirks are that you need to use double quotes, and objects can't have a trail…

In contrast, JSON is super intuitive and basically self documenting.

Personally I've found the exact opposite when dealing with 'normal' people. Most people can get basic YAML, but unless they're a programmers (or at least know how to program) most people fail miserably at writing JSON by hand.

Post reply on HN