What is YAML?
YAML is like JSON but more readable. The name stands for “YAML Ain’t Markup Language” (yes, it’s recursive).
YAML is super popular for configuration files because it’s clean and easy to read. Here’s what it looks like:
name: Alice
age: 30
email: [email protected]
hobbies:
- reading
- coding
- hiking
The key thing about YAML is that it uses indentation to show structure. No curly braces, no brackets for lists. Just clean, readable text.
Here’s the same data in JSON:
{
"name": "Alice",
"age": 30,
"email": "[email protected]",
"hobbies": ["reading", "coding", "hiking"]
}
YAML is easier to read, especially for config files with lots of nesting.
You’ll see YAML everywhere in modern development like in Ruby on Rails database configuration.
There’s also TOML, which is another config file format that tries to be simpler than YAML. But YAML won the popularity contest.