DEV Community

Discussion on: Which YAML style do you prefer?

Collapse
 
katiekodes profile image
Katie • Edited

Hmmm -- YAML preserves the ordering of maps, so you could get away with the first, but it seems to me that anything where you're literally calling things "first," "second," "third," etc. implies a list. Especially if you might later end up having to parse it into JSON or into programming languages where dicts aren't ordered.

But that's mostly if you think your numbers will stretch beyond, say, 10.

If you know it's more like "primary" and "backup," you could probably get away with either. What do your teammates like?

Also, you might want to add a "discuss" tag to this.

Collapse
 
nicolasmahe profile image
Nicolas Mahe

Thanks for your comment!

Hmmm -- YAML preserves the ordering of maps, so you could get away with the first, but it seems to me that anything where you're literally calling things "first," "second," "third," etc. implies a list.

The workflows are not actually ordered. My bad for using “first” and “second”, it brings confusion to the discussion. I will edit now.

What do your teammates like?

They prefer the map version but I want to make sure it’s the best ;)

Also, you might want to add a "discuss" tag to this.

Tag added. Thanks for the suggestion.