this post was submitted on 12 Nov 2023
743 points (96.7% liked)

Programmer Humor

19623 readers
92 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
[–] Gecko@lemmy.world 34 points 1 year ago (3 children)

YAML would such a nice language for config files but then it turns out that "no" is falsy and so a list of Scandinavian countries turns from

  • se
  • fi
  • no

into

  • "se"
  • "fi"
  • False

I wish there was like a JSON5 equivalent for YAML that just reduces its scope lol
(and no, TOML also looks ugly :P)

[–] Kanda@reddthat.com 19 points 1 year ago (1 children)

Norway is false and Finland isn't in Scandinavia

[–] dafo@lemmy.world 5 points 1 year ago* (last edited 1 year ago)

S W E D E N

S W E D E N

S W E D E N

[–] synae@lemmy.sdf.org 11 points 1 year ago (3 children)

This is definitely a failing of yaml. Though, I feel that generally it's the sort of thing you learn once the hard way, then it sticks with you pretty well.

Also I'm glad there are more anti-toml folks are out there, feels like I'm taking crazy pills when people say it is "simple" and "elegant". IMO it's uglier than old-school ini format - at least it's more strictly defined but that doesn't really sway me to convert

[–] AVincentInSpace@pawb.social 4 points 1 year ago

Which is better for structured data?

  • elegant, human readable, indentation sensitive language that's great for deep nesting but has some weird idiosyncrasies with some dynamically typed parsers being too smart for their own good
  • glorified ini

The choice is clear

[–] orangeboats@lemmy.world 3 points 1 year ago

TOML isn't elegant at all but damn, it is really simple.

[–] ApexHunter@lemmy.ml 1 points 1 year ago

If by simple you mean "can't count from 1 to 10 in a loop" and by elegant you mean "easier to understand than a one line perl script" then sure...

[–] Amaltheamannen@lemmy.ml 7 points 1 year ago (1 children)

You're looking for StrictYaml

[–] Gecko@lemmy.world 1 points 1 year ago

Looks interesting, I'll check it out, thanks :D