this post was submitted on 13 Nov 2023
107 points (82.4% liked)

Programmer Humor

19197 readers
965 users here now

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

founded 1 year ago
MODERATORS
 

And I'll show you YAML

(a continuation of this post)

you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 52 points 10 months ago (10 children)

JSON for serialization all the way. It’s simple and to the point. It does one thing and does it well. There’s little room for annoying surprises. Any JSON can easily be minified and prettified back and forth. If you want it in binary format you can convert it to BSON.

Yaml is too much of a feature creep. It tries to do way too many things at the same time. There are so many traps to fall into if you’re not cautious enough. The same thing can be written in multitudes of ways.

[–] [email protected] 30 points 10 months ago* (last edited 10 months ago) (7 children)

Yes, but whoever decided that json can't have trailing commas has my ire.

{ "a": 1,
  "b": 2,  <-- nope
}

There was some other pitfall I can't remember around missing keys and undefined, too, but I can't remember it now.

[–] [email protected] -3 points 10 months ago (3 children)

I'm pretty sure you can have trailing commas...

load more comments (2 replies)
load more comments (5 replies)
load more comments (7 replies)