What are YAML files used for?

722 views

I keep seeing them throughout GitHub repos, but I’m not sure what their purpose is. I tried looking it up on Google, but the explanations did not suffice. If you know their use, please ELI5

In: Technology

5 Answers

Anonymous 0 Comments

YAML is yet another data serialization format. It’s often used for configuration files. JSON can be interpreted as YAML, but YAML cannot necessarily be interpreted as JSON. And so, for greater portability, you might as well remain strict and just use JSON.

YAML is terrible. It’s poorly defined, whitespace is significant, there are ambiguities, and full support of YAML means a parser can execute code embedded in the YAML file. It’s not just a data format, it is effectively Turing complete. It’s popular with Python programs and on cloud platforms, where configuration management is a big and complex ordeal.

For the life of me I don’t understand the history, how YAML evolved and managed to propagate. Then again, I don’t understand how many terrible technologies take root. We have a rich assortment of serialization formats, configuration formats, and file formats. We have an assortment of embeddable macro languages so you can templatize anything (and YAML templates are very common, you’ll find YAML templates and YAML files for those templates used to produce YAML files for cloud software – originally there was YAML + Jinga, now there’s YAML + YTT; when templating your config files for your config files gets too hard to manage, yeah, it’s the template syntax to blame…).

For the most part, there’s no point in learning the YAML format by itself unless you’re using software that relies on YAML.

You are viewing 1 out of 5 answers, click here to view all answers.