• glibg10b@lemmy.ml
        link
        fedilink
        arrow-up
        3
        ·
        3 years ago

        Some applications don’t have enough config entries to warrant support for nested entries

        Some applications need variable-length data, and some even variable-length lists

        Some applications don’t care about having fast read/write times or a small memory footprint and can do with more complex formats that require the use of third-party libraries

        Some embedded applications (e.g. AVR) don’t have access to a whole lot of libraries

    • sugar_in_your_tea@sh.itjust.works
      link
      fedilink
      arrow-up
      5
      ·
      3 years ago

      Yup. If I have to pick one for a new project, I’ll go with TOML unless there’s a reason to pick something else. I like that it’s simple, while also having a bunch of features for when the project grows.

      • JackbyDev@programming.dev
        link
        fedilink
        English
        arrow-up
        1
        ·
        3 years ago

        Pretty much same here. With Spring stuff I still use YAML because TOML doesn’t have first class support yet. If TOML is an option I don’t have to go too far out of my way for them I go for it.

        YAML has too many foot guns. It’s still less annoying to read and write than JSON though. Properties files are okay but there doesn’t seem to be an agreed upon spec, so for edge cases it can be confusing.

    • Carlos Solís@communities.azkware.net
      link
      fedilink
      English
      arrow-up
      2
      ·
      3 years ago

      Agreed. YAML is a pain to edit manually, to ensure that all the tabulation is correct and the parser does not choke. JSON is passable, but you must be mindful about the brackets. XML is too verbose and duplicative. INI files are just good enough.

      • sugar_in_your_tea@sh.itjust.works
        link
        fedilink
        arrow-up
        4
        ·
        3 years ago

        That’s why I like TOML. It’s basically INI, but it has more structural features if you need them. Most of the TOML files I use look just like ini files.

      • exu@feditown.com
        link
        fedilink
        English
        arrow-up
        2
        ·
        3 years ago

        YAML is fine if you use a formatter. JSON’s ok to read but a pain to write imo. INI if it’s simple.

  • argv_minus_one@beehaw.org
    link
    fedilink
    arrow-up
    7
    ·
    3 years ago

    JSON is overly verbose and doesn’t allow comments. Please do not use it for anything that humans frequently need to read or write.

    YAML is a syntactic minefield. Please do not use it for anything ever.

  • Papamousse@beehaw.org
    link
    fedilink
    English
    arrow-up
    5
    ·
    3 years ago

    I’d say a file that you can open with a simple text editor is convenient, so it can be a simple .conf/.ini, more complex are .xml/.yaml that you can still edit in vim/nano but can be cumbersome.

    But as others say, it all depends on your app…

  • loathsome dongeater@lemmygrad.ml
    link
    fedilink
    English
    arrow-up
    4
    arrow-down
    1
    ·
    3 years ago

    I really dislike when indentation is a part of the syntax (like in YAML). Apart from that it depends on the requirements of the project.

  • The Doctor@beehaw.org
    link
    fedilink
    arrow-up
    3
    ·
    3 years ago

    Not XML. Not binary-only (looking at you, Solaris).

    Personally, I like .ini-style config files, but I’m weird that way.