YAML is essentially JSON without the brackets and commas. It's determined by indentation and line. It's supposed to be easier to read. YAML is generally used for config files that may require manual editing
and before anyone says I'm wrong and it's not like JSON
It uses both Python-style indentation to indicate nesting, and a more compact format that uses [] for lists and {} for maps[1]making YAML 1.2 a superset of JSON.[2]
It seems that your comment contains 1 or more links that are hard to tap for mobile users. I will extend those so they're easier for our sausage fingers to click!
Not really imo, because at the expense of verbosity you get flexibility (exception being Java), and XML is ten times more flexible than YAML.
EDIT: Apparently I have to explain myself. YAML has keys, values, and nesting. XML also has attributes and named elements (unlike YAML in which there's just "objects"), it's also not indentation-based, which makes it a hell of a lot more readable for complicated structures.
Never looked into it as far as any kind of performance. My gut would say no better or worse, as its going to be just as fast as reading any string, and I doubt that a tab, space, or new line character is going to be any different than processing a { or [. It might be though for really long ones, like 200mb+ but at that point I'd argue there's no point to use YAML anyway. Again, these are purely gut instinct, with no analysis or research behind it
The biggest functional benefit is the ability to write comments. JSON, being built simply to describe object state, doesn't have a particularly good way to embed comments. Some of the uses that JSON has been picked for, such as configuration, are really places that should support comments.
View all comments
Show parent comment
19
u/Excolo_Veritas Sep 13 '18
YAML is essentially JSON without the brackets and commas. It's determined by indentation and line. It's supposed to be easier to read. YAML is generally used for config files that may require manual editing
and before anyone says I'm wrong and it's not like JSON
https://en.wikipedia.org/wiki/YAML