34

Fuck. YAML.
Who the fuck thought this was a good idea?

Comments
  • 9
  • 3
    Yo fr...fuck YAML
  • 0
    That document is exaggerated... I don't want to elaborate on this having broken wrist, but those problematical cases - are far from real life... You have to try real hard to get into those problems.
  • 1
    Swagger.yaml is pretty much the standard
  • 5
    @mt3o Mostly agreed, but I've been personally bitten by a couple of those issues. One is how string words like "yes", "on", and "true" (and a few others) evaluate to a boolean True, and another is the fact that 1.0.0 is a string but 1.0 is a number.

    YAML often violates the principle of least surprise.

    Perhaps most annoying is significant whitespace combined with a strict prohibition on using tabs.
  • 3
    @Karunamon 1. 0 vs 1.0.0 is obvious to me. You can't parse the latter into a float.
    Regarding yes vs true it's also obvious.

    Those values are not informational plaintext but values that are parsed into strict types and have to be treated as such. You want a string, be explicit. Otherwise, the closest type will be matched.

    I see your examples in similar manner as 0.1 + 0.2 != 0.3 in any IEEE754 complaint scenario.

    Perhaps I see this differently than you because I already tried coding my own tokenizer and parser for my own config file format...
  • 2
    I've always hated YAML because my gut feeling was telling me it's bad. Good to see that it actually is. For my scripting language I have 4 core design rules: Consistency, predictability, reliability and conciseness. Apart from the last YAML breaks every single one
  • 1
    @halfflat JSON5 is much better
  • 3
    XML called from the last decade and asks you to hold their beer
  • 4
    @codebanana I would rather deal with XML than YAML.
  • 0
    @PrivateGER I haven't dealt with YAML that much tbh, but I can already assure you XML is, at the very least, as bad as YAML
  • 3
    @codebanana I deal with XML and it makes much more sense than YAML. I much prefer it over YAML.
  • 2
    @PrivateGER I've seen some "apocalypse now" level XMLs too, so i wouldn't be so easy on it either

    @12bitfloat i had that gut feeling too

    @mt3o > you want a string, be explicit
    that is terrible beyond any good will and redemption reasoning.
    if not being explicit can lead to bad side effects and there's not much benefit to it, why would they leave that in?

    that's some troll design, as if they designed it hoping to cause as much bugs as possible

    sure, i can be explicit, but i can't force these major projects that are not explicit on their ymls to be
  • 1
    @jesustricks I have also seen some horrible XML and still prefer that shit over YAML any day.
  • 0
    For the record, I'll take yaml over xml any day
  • 0
    @Plasticnova why "for the record" though? it's not like you were saying anything hinting a possible dislike of yml that you could clarify
  • 0
    @jesustricks because why not
  • 0
    @Plasticnova you're gonna double down on bad english? i would have taken a "mb"... just delete account man...
  • 0
    @jesustricks I can see this really bothers you. For the record, I'm ok with that
  • 0
    After being from the old times of programming and just debugging my first yaml files i was flabbergasted that anyone would make this.
Add Comment