And I’ll show you YAML

(a continuation of this post)

0 points

YAML is pretty good for readability, pretty awful for writability

permalink
report
reply
0 points

Rule of thumb: valid json is valid yaml. If you’re ever unsure, do it the old fashioned way.

permalink
report
parent
reply
0 points

I really don’t see how that’s true.

You’re telling me this is valid yaml?

{ firstName: “Intensely” }

How is that yaml?

permalink
report
parent
reply
-1 points

No, because that’s not valid json

permalink
report
parent
reply
0 points

Serializing? For serializing you probably want performance above all else. I’m saying this without checking any benchmark, but I’m sure yaml is more expensive to parse than other formats where indentation don’t have meaning.

For human readability: it has to be readable (and writeable) by all humans. I know (a lot of people) that dislike yaml, toml and XML. I don’t know of a single person that struggles to read/write json, there is a clear winner.

permalink
report
reply
0 points

I don’t know why we’re fucking about trying to use text editors to manipulate structured data.

Yeah, it’s convenient to just be able to use a basic text editor, but we’re not trying to cram it all on a floppy disk here. I’m sure we could have a nice structured data editor somewhere for all those XML, JSON and YAML files we’re supposed to maintain every day.

permalink
report
parent
reply
0 points

JSON would be perfect if it allowed for comments. But it doesn’t and that alone is enough for me to prefer YAML over JSON. Yes, JSON is understandable without any learning curve, but having a learning curve is not always bad. YAML provides a major benefit that is worth the learning curve and doesn’t have the issues that XML has (which is that there is no way to understand an XML without also having the XSD for it)

permalink
report
parent
reply

Programmer Humor

!programmer_humor@programming.dev

Create post

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

  • Keep content in english
  • No advertisements
  • Posts must be related to programming or programmer topics

Community stats

  • 7K

    Monthly active users

  • 730

    Posts

  • 11K

    Comments