this post was submitted on 12 Nov 2023
818 points (97.4% liked)

Programmer Humor

19213 readers
1414 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
 
you are viewing a single comment's thread
view the rest of the comments
[–] Michal@programming.dev 12 points 10 months ago (2 children)

How's it annoying? It's easier to edit by hand than json as it allows for comments and there's no trailing comma errors. I prefer it any day over json.

[–] magic_lobster_party@kbin.social 11 points 10 months ago

There’s a lot of foot guns in YAML. The specification is way more complicated with hidden obscurities. JSON specification is just 5 diagrams. YAML speciation on the other hand is an 86 page pdf, so there’s more room for nasty surprises (which is not a thing you want in configuration files).

I’ve also seen many people struggle more than they need to with the yaml indentation.

I think the only upside to yaml is that it allows for comments, but other than that JSON all the way.

https://ruudvanasseldonk.com/2023/01/11/the-yaml-document-from-hell

[–] TheGiantKorean@lemmy.world 4 points 10 months ago (1 children)

The fact that it allows comments is really, really handy. I used to be a JSON advocate until I realized this one useful piece of info.

[–] bellsDoSing@lemm.ee 2 points 10 months ago (1 children)

Yeah, such a simple, but still killer feature. Really sad that JSON doesn't support them.

[–] TheGiantKorean@lemmy.world 1 points 10 months ago (1 children)

I wonder how you'd even implement that. Like maybe {! At the beginning.

[–] GTG3000@programming.dev 1 points 10 months ago (1 children)

Most comment-aware JSON parsers I've seen just use standard // to delineate comment lines.

[–] TheGiantKorean@lemmy.world 1 points 10 months ago

They make sense.