DEV Community

Cover image for Quick guide for YAML

Quick guide for YAML

Maria 🍦 Marshmallow on February 10, 2023

YAML (short for "YAML Ain't Markup Language") is a data serialization format that is used to store and exchange data between different systems and ...
Collapse
 
martydevs profile image
Andre Marti

In another use cases, YAML is used for static sites and docs building tools like mkdocs and material mkdocs;

Through this language you can define the structure of any page or view. I share this use case because I used YAML for building a documentation site for an Desktop App.

Greetings from Mexico πŸ€ πŸ‘Œ

Collapse
 
mariamarsh profile image
Maria 🍦 Marshmallow

Thanks for pointing that out, Andre!

Collapse
 
philnash profile image
Phil Nash

Hi Maria, good introduction to a bunch of things that YAML can do. Have you checked out this article on some of the things that can go wrong with YAML though? It's important to know some of the issues YAML can cause as well as it's extensive feature-set.

Collapse
 
mariamarsh profile image
Maria 🍦 Marshmallow

I've read the article you're referring to; it's really awesome if you need more information about YAML and its challenges πŸ‘πŸ»

Collapse
 
buzzdee profile image
Sebastian Schlatow • Edited

Some people say YAML is Gammel, but not me. πŸ˜‰

Collapse
 
mariamarsh profile image
Maria 🍦 Marshmallow

I completely agree 😁

Collapse
 
amyswen451 profile image
Amanda Swensen

I believe, that YAML can be a valuable skill to learn because of its widespread use in various fields such as software development, configuration management, and DevOps.
Awesome post, btwπŸ‘πŸ»

Collapse
 
mariamarsh profile image
Maria 🍦 Marshmallow

Great point, Amanda☺️

Collapse
 
assunluis80 profile image
LuΓ­s Assunção • Edited

From my experience YAML it's "simple" and "human readable" only for a few lines of code... For large lines of configuration, is too messy and unreadable. I wouldn't recommend it for large configurations.

Collapse
 
mariamarsh profile image
Maria 🍦 Marshmallow

I understand what you mean. YAML (YAML Ain't Markup Language) is indeed designed to be simple and easy to read for human beings, but as the complexity of the configuration increases, it can become more difficult to read and maintain. For larger configurations, alternative data formats, such as JSON or XML, may be more suitable as they offer more structured and standardized ways of representing complex data.

However, YAML still has its advantages, such as its clean and concise syntax, which makes it easier to write and understand than other formats. Additionally, many popular software tools, such as Kubernetes and Ansible, use YAML as their configuration file format, which makes it widely used and well supported in the community.

Collapse
 
phophogr profile image
Phoebe Green

Thanks, Maria for such an informative post! For me, the dest thing in YAML is simple and readable syntax

Collapse
 
mariamarsh profile image
Maria 🍦 Marshmallow

Completely agree!

Collapse
 
igibsonconor profile image
Conor Gibson

Great post! I've question regarding YAML: How does YAML syntax compare to other data serialization formats in terms of simplicity and readability? Just to clarify)

Collapse
 
mariamarsh profile image
Maria 🍦 Marshmallow

YAML is known for its simple and human-readable syntax, making it a popular choice for data serialization. Compared to other formats like XML and JSON, YAML has a lower learning curve and requires less code to represent the same data, making it easier to read and write for developers. However, YAML does have some limitations in terms of data typing and structure compared to more robust formats like JSON and XML.

Collapse
 
zaidsab3 profile image
Zaid Sab

The structure of any page or view may be defined using this language, which is also used for static sites and docs creation tools like mkdocs and material mkdocs. I'm sharing this use example since I built a documentation website for a desktop app using YAML.

Collapse
 
mariamarsh profile image
Maria 🍦 Marshmallow

Sounds like a great experience!

Collapse
 
kumarkalyan profile image
Kumar Kalyan

Great article @mariamarsh

Collapse
 
mariamarsh profile image
Maria 🍦 Marshmallow

Thank you, Kumar☺️

Collapse
 
jwp profile image
John Peters

What does this mean?
!!yes bool

Collapse
 
mariamarsh profile image
Maria 🍦 Marshmallow

The expression "!!yes bool" is a reference to a boolean value in programming. The double exclamation marks (!!) before "yes" indicate a forced conversion of the string "yes" to a boolean value. Since the string "yes" is a truthy value, this conversion would result in the value "true".

Collapse
 
lico profile image
SeongKuk Han

Altough I didn't understand the part of type section, overall, easy to understand and good explanation :) Thank you for sharing the good post :)

Collapse
 
vladttempest profile image
Alejandro Aguilera Wilches

Intersting, and what about TOML? Could you check on this...

Collapse
 
mariamarsh profile image
Maria 🍦 Marshmallow

I believe YAML is more widely adopted and supported by a larger number of programming languages and tools, while TOML is a newer format with a smaller community of users and integrations. However, I'll consider it one of the future topics for my posts!

Collapse
 
arashrah profile image
Arash Rahimi

Good article, I enjoyed reading it! If you're interested, feel free to check out my articles as well

Collapse
 
bernardoow profile image
Bernardo Gomes

Hi thanks for sharing!!

I liked the text. It's direct and concise.