Data structure terminology
Did you know there is now such thing as a YAML list or a JSON dictionary?
Let's get the terminology straight for basic data structures across four of the code languages we could encounter in the DevNet certification program.
Python |
JSON |
YAML |
HCL |
A Python dictionary contains multiple entries
|
A JSON object contains multiple properties
|
A YAML mapping contains multiple key-value pairs
|
An HCL map contain multiple key-value pairs
|
A Python list contains multiple items
|
A JSON array contains multiple elements
|
A YAML sequence contains multiple elements
|
An HCL list contains multiple elements
|
A Python tuple contains multiple values
|
JSON doesn't support tuples | YAML doesn't support tuples |
Tuple contains multiple values
|
A Python set contains multiple elements
|
JSON doesn't support sets | YAML doesn't support sets |
Set contains multiple values
|
So if you really want to use exactly the right terms, the table above can help you.
XML and YANG terminology run their its own games and doesn't compare well with these four, so we will look closer at those terminology separate blog posts.