7

Learning YAML - YAML Ain't Markup Language

 3 years ago
source link: https://hackernoon.com/learning-yaml-yaml-aint-markup-language-co4f354m
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
YAML Ain't Markup Language

It has clear formatting which makes it human-readable, easy to use, and is easily implemented.

0 reactions

YAML minimizes the number of structural characters and allows the data to be represented in a meaningful way. For example, indentation is used for structure, key-value pairs are separated by colons, and dashes are used to create bullet lists. Hence the format appears clearer and can be easily understood.

0 reactions

Let us take an example and compare it with JSON and XML:-

0 reactions

YAML

0 reactions
Employees:
  -  id: 4
     employeename: Ryan                  
     employeetitle: Marketing Manager 

JSON

0 reactions
{
"Employees": [
  {
    "id":  4,
    "employeename":  "Ryan",
    "employeetitle":  "Marketing Manager"
  }
]
}

XML

0 reactions
<?xml version="1.0" encoding="UTF-8"?>
<Employees>
   <id>4</id>
   <employeename>Ryan</employeename>
   <employeetitle>Marketing Manager</employeetitle>
</Employees>

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK