YAML
Also known as: YAML Ain't Markup Language, YML
YAML is a text format for writing structured data, mainly configuration files, that uses indentation and simple dashes instead of brackets and quotation marks.
It's widely used in DevOps and cloud tools such as Kubernetes, GitHub Actions, Docker Compose, and Ansible. YAML is easy to read and allows comments. While it's friendlier than JSON for humans, its reliance on precise indentation and some surprising automatic type conversions can cause hard-to-spot errors.
YAML, explained at three levels
At home
YAML is like a tidy outline, where indentation shows which items belong under which heading. Computers read the outline to learn their settings.
At work
YAML files configure many cloud and automation tools, so small mistakes can affect live systems.
At home
In YAML, spaces matter, and tabs aren't allowed for indentation. Using an editor that highlights YAML errors helps a lot.
At work
YAML supports comments, lists, and nested settings. Store YAML configs in version control and validate them with linters and schema checks in CI pipelines.
At home
Values like 'yes,' 'no,' 'on,' or '0123' can be misinterpreted by some YAML tools. In my opinion, putting text values in quotation marks avoids surprises.
At work
Use safe loading functions, since some YAML parsers can execute code when loading untrusted files. Prefer YAML 1.2 parsers and template tools that validate output before deployment.
Real-world examples
At home
Carlos set up a home automation system configured with YAML. A single misaligned space broke it until his editor highlighted the error.
At work
Nadia manages Kubernetes for a Toronto startup. She added YAML linting to every pull request after a typo took down a service.
How it compares
| feature | YAML | JSON |
|---|---|---|
| Structure | Indentation | Braces and brackets |
| Comments | Yes | No |
| Common use | Configuration | Data exchange |
| Error risk | Whitespace mistakes | Punctuation mistakes |
YAML is easier to read. JSON is easier for machines to parse.
For analysts
Where configuration lives in YAML, I'd require review and automated validation. Configuration errors cause a large share of production outages.
History & origin
Clark Evans, Ingy döt Net, and Oren Ben-Kiki created YAML in 2001. Its name originally meant 'Yet Another Markup Language' but was changed to the recursive 'YAML Ain't Markup Language' to emphasize data over documents. YAML 1.2, published in 2009, aligned it more closely with JSON, making most JSON valid YAML. The rise of DevOps, configuration management, and Kubernetes in the 2010s made YAML ubiquitous, with some engineers joking that their job had become 'YAML engineering.' A famous quirk, the 'Norway problem,' saw older YAML parsers read the country code NO as 'false.' In my view, YAML is pleasant to read and painful to debug.