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?

  • Vivendi@lemmy.zip
    link
    fedilink
    arrow-up
    0
    ·
    edit-2
    2 months ago

    Can people stop hating on shit?

    FOR FUCKS SAKE, negative reinforcement dopamine has RUINED THE FUCKING NET.

    EVERYWHERE I GO there’s someone bitching about something, hate circlejerks are unbelievably popular, people just love to hate on stuff.

    You’re ruining your thought patterns with all these social media negativity bullshit.

    Fucking TOML users hate on fucking YAML fucking C++ users hate Rust fucking Rust users hate literally everything under the sun and are insufferable to work with

    EVERYONE, fucking CHILL

    • orcrist@lemm.ee
      link
      fedilink
      arrow-up
      0
      ·
      2 months ago

      No seeds no stems no stress my guy. The Internet is a great place for complaining. Readers can downvote and move on, everyone gets what they want.

    • Sir Gareth@programming.dev
      link
      fedilink
      arrow-up
      0
      ·
      2 months ago

      Yeah TBH I like yaml. Sure its not the best ever, but its not the worst it could possibly be.

      For config its not terrible. For ansible playbooks its again… not terrible.

      Why is everyone always hating on something which is just kinda mid.

      • wewbull@feddit.uk
        link
        fedilink
        English
        arrow-up
        0
        ·
        2 months ago

        Config is fine, but Yamls biggest problem is people use it to describe programs. For example: playbooks. For example: CI steps.

        If YAML wasn’t abused in this way it would have a lot less hate.

        • derpgon@programming.dev
          link
          fedilink
          arrow-up
          0
          ·
          2 months ago

          What’s wrong with using YAML for CI? I mean, I use it for Gitlab CI, the underlying script it runs is just Bash.

          • cashew@lemmy.world
            link
            fedilink
            arrow-up
            0
            ·
            2 months ago

            You’re doing it right by avoiding as much of Gitlab’s CI features. I’ve seen versions where scripts are inlined in the YAML with expressions in random rule fields and pipeline variables thrown all over the place. And don’t get me started on their “includes” keyword, it’s awful in practice, gives me nightmares.

            Then I write a Kubernetes manifest in YAML with JSON schema validation and the heart rate goes down again.

          • wewbull@feddit.uk
            link
            fedilink
            English
            arrow-up
            0
            ·
            2 months ago

            Right, so you just have a single step and then hand over to a proper script. I’ve seen many people try to put much more complex logic in there before handing over to a proper language.

      • SandLight@lemmy.world
        link
        fedilink
        English
        arrow-up
        0
        ·
        2 months ago

        I dream of a life where I use YAML but all my configs are stuck in XML. People can complain but there’s always worse options.

        • FizzyOrange@programming.dev
          link
          fedilink
          arrow-up
          0
          ·
          2 months ago

          One nice thing about XML is that there’s an official way to link to the schema from within the document. If you do that you can easily automatically validate it, and even better you get fantastic IDE support via Red Hat’s LSP server. Live validation, hover for keys, etc.

          It’s a really nice experience and JSON schema can’t really match it.

          That said, XML just has the wrong data model for 99% of use cases.

  • lehenry@lemmy.world
    link
    fedilink
    arrow-up
    0
    ·
    2 months ago

    I think TOML should replace YAML for config files, it is much clearer, easier to parse for a human.

    • NostraDavid@programming.dev
      link
      fedilink
      arrow-up
      0
      ·
      2 months ago

      Depends on the data structure. If you want to save a table of sorts, you’re getting a bunch of unreadable [[[]]] nonsense.

      For flat structures it’s great though.

  • thingsiplay@beehaw.org
    link
    fedilink
    arrow-up
    0
    ·
    2 months ago

    I don’t like it either, but I’m not entirely sure why. Maybe the biggest flaw to me is it uses Python style indentation for structuring as part of data logic. It doesn’t feel like a configuration language to me and it does not feel simple too. It’s also unlike most programming language structures (maybe besides Python), so it looks weird to read and write. Other than that, I don’t know exactly why I don’t like this format much. Admittedly, I did not do much in YAML, so because lack of experience take my opinion with a thick grain of salt.

    We have JSON and TOML. I quiet like TOML. We have “better” alternatives, that are probably easier to parse. And therefore there is not much need for YAML. Maybe if YAML was the default config format for Python it would get off the ground and be accepted more often.

  • demesisx@infosec.pub
    link
    fedilink
    English
    arrow-up
    0
    ·
    edit-2
    1 month ago

    I used to think json was the best until I found json lines or line delimited json. Thank me later. I use it all the time. You can append until you’re blue in the face. It’s great for log files. Each line is a valid json file.

  • mox@lemmy.sdf.org
    link
    fedilink
    arrow-up
    0
    ·
    edit-2
    2 months ago

    One pattern I’ve noticed is people seeking a language that’s better than {JSON,XML,INI,etc} at wrangling their slightly complex configuration files, discovering the additional features and type support offered by YAML, and assuming it will be a good solution.

    Then, as their configs grow ever larger and more complex, they discover that expressing them in YAML requires large sections of deep nesting, long item sequences, and line wrapping. The syntax style that they saw working well in other places (e.g. certain programming languages) breaks down quickly at that level of complexity, making it difficult for humans to correctly write and follow, and leading to frequent errors.

    YAML doesn’t suck for small stuff, IMHO. But it is more complex than necessary for small stuff.

    For things likely to grow to medium-large size or complexity, I would recommend either breaking up the data into separate files, or looking for a different config/serialization language.

  • magic_lobster_party@fedia.io
    link
    fedilink
    arrow-up
    0
    ·
    2 months ago

    I don’t like YAML because it’s overly complicated. The specification is like 80 pages long. How the hell did they think that was a good idea?

    JSON on the other hand is super simple. It doesn’t do more than it needs to.

    Just compare this: https://yaml.org/spec/1.2.2/

    With this: https://www.json.org/json-en.html

    The entire JSON specification is shorter than just the table of contents of the YAML specification!

    Another thing I like about JSON is that you can format it however you want with the whitespace. Want everything on one line? Just write everything on one line!

    If data can be represented as a JSON, then there’s generally only one way to represent it in JSON (apart from whitespace). In YAML the same data can be represented in 1000s of different ways. You pick one.

    • lemmyng@lemmy.ca
      link
      fedilink
      English
      arrow-up
      0
      ·
      2 months ago

      I will never forgive JSON for not allowing commas after the last element in a list.

    • verstra@programming.dev
      link
      fedilink
      arrow-up
      0
      ·
      2 months ago

      This is the major reason for me. I really liked yaml, because it is way more readable to me than JSON. But then I kept finding new and more confusing yaml features and have realized how over-engineered it is.

      Yaml would be great language if it had its features prunned heavy.

  • ulkesh@beehaw.org
    link
    fedilink
    English
    arrow-up
    0
    ·
    2 months ago

    White space/indentation as a construct of the syntax.

    It’s why I have a hard time with python.

    People have their likes and dislikes. Nothing wrong with that.

    • tibi@lemmy.world
      link
      fedilink
      arrow-up
      0
      ·
      2 months ago

      Sadly, unreadable on mobile. Text doesn’t word wrap, dragging to pan it is annoying and makes the keyboard show up.

    • MajorHavoc@programming.dev
      link
      fedilink
      arrow-up
      0
      ·
      2 months ago

      That is amazing.

      I don’t know what I just read.

      If my website ever gets married, I’m going to invite this website to stand next to it as a bridesmaid - because it makes my website look pretty by comparison.

  • corsicanguppy@lemmy.ca
    link
    fedilink
    English
    arrow-up
    0
    ·
    2 months ago

    We all know it sucks. I have no idea why people use it instead of anything else. My workday is jammed with fucking ansible which, while also being so ghetto that we were easily doing more with less in 2002, uses So.much.fucking.yaml . Just when you think ansible couldn’t get more clunky and useless and slow, it also is configured in yaml.

  • Reddfugee42@lemmy.world
    link
    fedilink
    English
    arrow-up
    0
    ·
    2 months ago

    I don’t like a thing, fellas. With that being all I’ve told you, please explain why I don’t like that thing.

  • MajorHavoc@programming.dev
    link
    fedilink
    arrow-up
    0
    ·
    2 months ago

    If YAML and JSON were gripping my hands for dear life, dangling off of a cliff…

    I would let both drop into the abyss so I could spend more time with INI.

  • gencha@lemm.ee
    link
    fedilink
    arrow-up
    0
    ·
    2 months ago

    Following along with the style of your own post: YAML doesn’t suck, because I feel so.

    Thanks for asking.

  • Damage@feddit.it
    link
    fedilink
    arrow-up
    0
    ·
    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.