FOR FUCKS SAKE, negative reinforcement dopamine has RUINED THE FUCKING NET.
EVERYWHERE I GO there's someone bitching about something, hate circlejerks are unbelievably popular, people just love to hate on stuff.
You're ruining your thought patterns with all these social media negativity bullshit.
Fucking TOML users hate on fucking YAML fucking C++ users hate Rust fucking Rust users hate literally everything under the sun and are insufferable to work with
Programmers hate everything. You could design a spec which serenades you with angel song and feeds you chocolate dipped grapes and someone would be like: This is awful, my usecase is being a dog.
Because people over use it. YAML is pretty good for short config files that need to be human readable but it falls apart with complex multi line strings and escaping.
I think there are much better clearly delimited for machine reading purposes formats out there that you should prefer if you're writing a really heavy config file and, tbh, I think for everything else .ini is probably "good enough".
One pattern I've noticed is people seeking a language that's better than {JSON,XML,INI,etc} at wrangling their slightly complex configuration files, noticing the additional features and type support offered by YAML, and assuming it will be a good solution.
Then, as their configs grow ever larger and more complex, they discover that expressing them in YAML requires large sections of deep nesting, long item sequences, and line wrapping. The syntax style that they saw working well in other places (e.g. certain programming languages) breaks down quickly at that level of complexity, making it difficult for humans to correctly write and follow, and leading to frequent errors.
YAML doesn't suck for small stuff, IMHO. (But it is more complex than necessary for small stuff.)
For things likely to grow to medium-large size or complexity, I would recommend either breaking up the data into separate files, or looking for a different config/serialization language.
The entire JSON specification is shorter than just the table of contents of the YAML specification!
Another thing I like about JSON is that you can format it however you want with the whitespace. Want everything on one line? Just write everything on one line!
If data can be represented as a JSON, then there’s generally only one way to represent it in JSON (apart from whitespace). In YAML the same data can be represented in 1000s of different ways. You pick one.
To paraphrase: There are two kinds of markup languages. Those that people complain about and those that nobody uses.
There is no silver bullet that will work perfectly for all use cases and we also don't want to use 100 different tools. So people use things that aren't perfect. But they're good enough. I don't think YAML is perfect and I still use it, because people know it and there are tons of tools already available.
Tons of people making Python comparisons regarding indentation here. I disagree. If you make an indentation error in Python, you will usually notice it right away. On the one hand because the logic is off or you're referencing stuff that's not in scope, on the other because if you are a sane person, you use a formatter and a linter when writing code.
The places you can make these error are also very limited. At most at the very beginning and very end of a block. I can remember a single indentation error I only caught during debugging and that's it. 99% of the time your linter will catch them.
YAML is much worse in that regard, because you are not programming, you are structuring data. There is a high chance nothing will immediately go wrong. Items have default values, high-level languages might hide mistakes, badly trained programmers might be quick to cast stuff and don't question it, and most of the time tools can't help you either, because they cannot know you meant to create a different structure.
That said, while I much prefer TOML for being significantly simpler, I can't say YAML doesn't get the job done. It's also very readable as long as you don't go crazy with nesting. What's annoying about it is the amount of very subtle mistakes it allows you to make. I get super anxious when writing YAML.
YAML works great for small config files, or situations where your configuration is fully declarative. Go look at the Kubernetes API with its resources.
People think YAML sucks because everyone loves creating spaghetti config/templates with it.
One reason it tends to become an absolute unholy mess is because people work around the declarative nature of those APIs by shoving imperative code into it. Think complicated Helm charts with little snippets of logic and code all over the place. It just isn't really made for doing that.
It also forces your brain to switch back and forth between the two different paradigms. It doesn't just become hard to read, it becomes hard to reason about.
It sucks the same way Python sucks. Some people just really don't like indentation-based syntax. I'm one of them, so I dislike both formats. However, if you groove on that sort of thing, I don't think YAML is any worse than any other markup.
Oddly, I get along with Haskell, which also used indentation for scoping/delimiting; I can't explain that, except that, somehow, indentation-based syntax seems to fit better with functional languages. But I have no clear argument about why; it's just an oddity in my aesthetics.
I didn't use yaml much while it was gaining popularity, and therefore didn't pay much attention. But this article really made me pay attention and now I distrust anything that uses yaml in any capacity.
I hated yaml with every fiber of my being when first had to use it, but I really wanted to use HomeAssistant and see what I could do with it. I hated it a bit less when I started using docker compose. I started loving it when I started using it as a way to explain json to non-programming IT types, trying to explain it without braces and brackets seems to get across easier. I guess its more human readable, but as a result formatting has to be spot on (those indents and spaces replace the need for brackets and braces).
One useful trick if you truly hate it but need it, write it in json, then just use a converter to change that into yaml.
YAML had comments and trailing commas, therefore it's objectively better than JSON. If you want a compromise solution that mostly looks like JSON, try JSON5.
I don't hate YAML, but it has the same issues languages like PHP and JS introduce...there are unexpected corner cases that only exist because the designer wanted the language to be "friendly"
I used to think json was the best until I found json lines or line delimited json. Thank me later. I use it all the time. You can append until you’re blue in the face. It’s great for log files. Each line is a valid json file.
We all know it sucks. I have no idea why people use it instead of anything else. My workday is jammed with fucking ansible which, while also being so ghetto that we were easily doing more with less in 2002, uses So.much.fucking.yaml . Just when you think ansible couldn't get more clunky and useless and slow, it also is configured in yaml.
I don't like it either, but I'm not entirely sure why. Maybe the biggest flaw to me is it uses Python style indentation for structuring as part of data logic. It doesn't feel like a configuration language to me and it does not feel simple too. It's also unlike most programming language structures (maybe besides Python), so it looks weird to read and write. Other than that, I don't know exactly why I don't like this format much. Admittedly, I did not do much in YAML, so because lack of experience take my opinion with a thick grain of salt.
We have JSON and TOML. I quiet like TOML. We have "better" alternatives, that are probably easier to parse. And therefore there is not much need for YAML. Maybe if YAML was the default config format for Python it would get off the ground and be accepted more often.
YAML is fine if you use a subset (don't use the advanced features - not like you know those anyway) and use explicit strings (always add " to strings), otherwise things may be cast when you did not intend values to be cast.
Example:
country: NO (Norway) will be cast to country: False, because it'll cast no (regardless from casing) to false, and yes to true.
I think much of the issue with YAML is that it's often paired with bad editors. You need a way to manage the whitespace, collapse sections, etc. Notepad doesn't cut it.
It's docs are garbage, but the language is quite simple and human readable even for non-techies. I think it's a bit too easy at times, resulting in people just kinda winging it
Yaml is fundamentally the same as the json and xml it has mostly replaced (and the toml that didn't manage to replace yaml)... it's a data serialization format and just doesn't have any facility for making abstractions, which are the main tool we human use to deal with complexity.