Hate YAML!
YAML stands for YAML (Not XML), and text-based, the human-readable language used in mainly pipeline tools. YAML is widely used in configuration files, like Circle CI, Travis CI, Azure DevOps, Jenkins, Sprint Boot, Docker, Chef, Ansible, Kubernetes, AWS CloudFormation and more. YAML has been started (around) since 2001 and the use of YAML is growing up quite quickly.
As we all know how useful it is, now I’m going to talk about why we need to stop using YAML. Of course, it will work if there is alternative one. I’m not against YAML engineering, I still think in many cases YAML is much better than JSON (No comment allowed) and (fxxkin) XML. But just warn that you need to consider SOMETHING when your engineering is heavily rely on YAML. Then we can be prepared before starting using YAML to have good to best practices in your YAML engineering.
(1) Human-readable?
Chef, Ansible, Kubernetes and many tools use YAML to provision large, complex enterprise infrastructure. In the YAML code, there are a lot of factors to be considered not only necessary resources to be provisioned but also many configurations, security settings, and variables required to launch the web engines. It may be ended up with 20,000 lines codes in 4–5 depths of the repository tree.
If you are the engineer to initiate the infrastructure, define all guidelines, standards and actually structure & code the YAML, you can understand 20,000 lines in 200 files. But the resources will be larger as the business goes larger and of course the engineers will repeat joining/leaving continuously. Without having documentations with diagrams, configurations, and definitions, your companies may no longer have master engineer who understand everything.

(2) YAML specification is ambigous
YAML sometimes makes trouble when it’s not a declarative enough, but written in YAML. Then it will make you more hard to read them.
This may be true or false. But you can easily see the interpreted result from the same contents by parsing may be different from what it was defined yesterday.

(3) IDE may not help you
Most of engineers are using their own (familiar) IDE based on what kind of language you are using. But as YAML is declartive language, IDE will only give you high-level error notifications if you are doing wrong. Rather you won’t get an error messages if the error is not detected by your IDE, as the code may be cryptic. You always need to understand specs to avoid the errors and detect them before you provision huge infrastructure. Here is some tips you can refer to. https://www.redhat.com/sysadmin/yaml-tips
Hm… it doesn’t actually look like too bad… comparing to using JSON, XML, and any other languages. But we can always make some viewpoints (Good practices) before using YAML.
- Structure YAML files
- Comments for next engineers
- Read specs (documents for tools) carefully
- Configure your IDE
- Share good tips with your engineers
Of course, we also can find many anti-YAML solutions like
- https://pyyaml.org/ (Usin python to generate YAML files)
- https://www.cncf.io/online-programs/end-yaml-engineering-with-cdk8s/ CDK8s (Dev friendly alternative to YAML for Managing Kubernetes cluster)
- Best alternative is JSON (Not XML, please don’t go back to ancient times.
- Visualized tools (e.g. https://k8syaml.com/)
- Converters (e.g. JSON to YAML https://www.json2yaml.com/)