this post was submitted on 06 Sep 2024
61 points (73.6% liked)

Programming

17352 readers
358 users here now

Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!

Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.

Hope you enjoy the instance!

Rules

Rules

  • Follow the programming.dev instance rules
  • Keep content related to programming in some way
  • If you're posting long videos try to add in some form of tldr for those who don't want to watch videos

Wormhole

Follow the wormhole through a path of communities [email protected]



founded 1 year ago
MODERATORS
61
Why YAML sucks? (programming.dev)
submitted 2 months ago* (last edited 2 months ago) by [email protected] to c/[email protected]
 

I feel that Yaml sucks. I understand the need for such markup language but I think it sucks. Somehow it's clunky to use. Can you explain why?

(page 2) 50 comments
sorted by: hot top controversial new old
[–] [email protected] 4 points 2 months ago

It's a rube goldberg footgun

[–] [email protected] 4 points 2 months ago* (last edited 2 months ago) (1 children)

YAML is fine if you use a subset (don't use the advanced features - not like you know those anyway) and use explicit strings (always add " to strings), otherwise things may be cast when you did not intend values to be cast.

Example:

country: NO (Norway) will be cast to country: False, because it'll cast no (regardless from casing) to false, and yes to true.

country: "NO" should not be cast.

[–] [email protected] 2 points 2 months ago* (last edited 2 months ago) (1 children)

People are working on making S-Expressions a standard: https://datatracker.ietf.org/doc/draft-rivest-sexp/

Note: This is just a draft, but improvements have been happening since 2023.

I probably won't like the parentheses, but I think I'll take it over yaml/json/whateverelse.

[–] [email protected] 7 points 2 months ago (2 children)

That appears to not support comments. How they made that mistake after JSON is a mystery.

load more comments (2 replies)
[–] [email protected] 4 points 2 months ago
[–] [email protected] 3 points 2 months ago

I think much of the issue with YAML is that it's often paired with bad editors. You need a way to manage the whitespace, collapse sections, etc. Notepad doesn't cut it.

[–] [email protected] 3 points 2 months ago (1 children)

I wish s-expression was a popular alternative. It's readable without the yaml issues.

load more comments (1 replies)
[–] [email protected] 2 points 2 months ago (9 children)

Yes, they could've just used JSON. Totally pointless waste of time.

[–] xmunk 5 points 2 months ago (1 children)

So Poe's Law and all that... I really hope you're being sarcastic because having non-technical people hand edit JSON is a nightmare. It's also quite annoying to read without a lot of extra whitespace which most editors that'd help less technical folks omit... and comments to help highlight what different things mean are hacky, hard to read, and actually read as data.

load more comments (1 replies)
load more comments (8 replies)
load more comments
view more: ‹ prev next ›