Why do I hate TOML and love YAML? reddit / selfhosted ---------------------------------------------------------------------- RapidScampi · 2023-11-14 00:19 I dunno why, but I have a thing against TOML. I could be reading a blog post and marvelling at the intellect of the author, but if it cuts to a code snippet of TOML I smack my teeth and question how I ended up on such an amateur site. My opinion is not rational neither is it grounded in any technical reasoning or logic. I'd even consider myself syntactically promiscuous when it comes to pretty much any other markup language. For some reason YAML and TOML make me feel like I need to pick sides and I'm definitely a YAMLite. I'm curious to know whether anyone else is this abnormally partisan towards YAML and TOML? ---------------------------------------------------------------------- ava1ar · 2023-11-14 00:56 I personally prefer hocon/typesafe and don't like yaml because of indent-based notation. Did you check https://hitchdev.com/strictyaml/why-not/toml/ ? This web site has best comparison and analysis of the configuration formats I saw so far. ---------------------------------------------------------------------- NikStalwart · 2023-11-14 02:43 To misquote Obi-Wan Kenobi, "You will find that many of the ~~truths~~ tools we cling to depend greatly on ~~our point of view~~ the thing we started with". Some people swear by nano, but I started with ViM and I'll stick with ViM until the heat death of the universe. I have a pathological hatred of webuis but I am fine with tui/cli. Et cetera. I don't remember the last time I dealt with TOML, but I found YAML to be extremely intuitive. Indentation is not an issue if you use a proper text editor. ---------------------------------------------------------------------- xkcd__386 · 2023-11-14 04:20 I suspect you're either reacting to the "Tom" (which is what the T in TOML stands for), making it sound like some "one guy's" project that never really took off... ...or the fact that it reminds you of the Windows INI file format. (TBH, `git`'s config file also uses something that reminds me of Windows INI, and it took me a while to get over it) ---------------------------------------------------------------------- R_X_R · 2023-11-14 04:56 I mostly deal with Ubuntu, so a typical hand built server is: `vim /etc/netplan/99-config.yaml` Command not found…. “Sigh” `apt install vim` Yaml was the first I spent serious time with, and (maybe) incidentally the one that clicked the most. Though that’s the same for vim for me. I use it to parse logs and write notes. Both of which my coworkers find almost as scary as just opening terminal and typing ssh, rather than putty. ---------------------------------------------------------------------- ithilelda · 2023-11-14 05:21 From my point of view, most things related to software config is hierachical, meaning that a tree like structure is the most intuitive in understanding them. YAML is tree based, while TOML is section based. I find YAML much easier to keep track of. And I have great experience with Python, so the indentation is pretty straight forward for me. But I'm not picking sides and defying the other. It's purely personal mind set related. Actually I do find some workflow very suited for TOML, like build systems, where each task is in its own section, shouting clear cut domain and dependency boundaries. ---------------------------------------------------------------------- iavael · 2023-11-14 07:15 TOML is tree-based too. It's just more verbose than YAML for explicivity. ---------------------------------------------------------------------- till · 2023-11-14 12:14 Why not hate both? 🙈😬 ---------------------------------------------------------------------- he-tried-his-best · 2023-11-14 13:33 Fuck indent based notation in general. ---------------------------------------------------------------------- lilolalu · 2023-11-14 18:26 Why not just let ChatGPT handle it don't give a damn :) ---------------------------------------------------------------------- lilolalu · 2023-11-14 18:26 Fuck it all ---------------------------------------------------------------------- contradictingpoint · 2023-11-14 19:24 And love json? ---------------------------------------------------------------------- Vogete · 2023-11-14 22:47 This is honestly the best way to put it. You're probably the first person I've seen to admit "it's basically habit". Most people I meet must argue and fight religious wars over editors and distros. Kudos, very well put! ---------------------------------------------------------------------- Vogete · 2023-11-14 22:49 Json with comments is literally perfect. Formattable, machine parsable, minimisable, easy and fairly concise. Honestly I can't think of anything better. (Comments in json are essential IMO, without it it's actually not that great, and I'd go with yaml instead) ---------------------------------------------------------------------- NikStalwart · 2023-11-14 23:14 Python has entered the chat. ---------------------------------------------------------------------- he-tried-his-best · 2023-11-14 23:29 Ugh. I learnt Java and C# as my primary language back in the day. Imagine my disgust when I took a look at python to teach my kids. Just so wrong ---------------------------------------------------------------------- platypus_plumba · 2023-11-15 01:12 It grows on you over time, but it takes a long time. ---------------------------------------------------------------------- HildemarTendler · 2023-11-15 01:29 I'm always confused by this. Do you not indent blocks in your Java/C# code? ---------------------------------------------------------------------- ava1ar · 2023-11-15 02:51 We do, but in Java/C# indentation is just a formatting question - you can autofotmat code back and force without any issues. In Python formatting drives the application logic and this this very-very wrong concept. ---------------------------------------------------------------------- he-tried-his-best · 2023-11-15 07:04 Blocks are started and ended with curly braces. It’s really obvious where a for loop or if statement starts and ends. You don’t have to be careful about how indented a particular line is. Horrible. ---------------------------------------------------------------------- till · 2023-11-15 14:35 I know it’s kinda cheap, but for me nothing is the answer (that includes hcl). I’ll use what I find, but I can’t say that I love anything. If something uses toml, I will use toml. I’ve also used json-schema in the past. Depending on what I do I find yaml and kustomize okay, etc.. Using something like client-go has its advantages as well. If I am building something from scratch then I would reach for a simple ini. I feel like everything else overcomplicates things and that’s usually a symptom for something else. ---------------------------------------------------------------------- till · 2023-11-15 14:37 ChatGPT is a great clippy replacement for spellchecking and grammar. ---------------------------------------------------------------------- HildemarTendler · 2023-11-15 14:37 There's just no difference. Indentation is a fine structure, everyone should be using it anyway no matter the language. ---------------------------------------------------------------------- HildemarTendler · 2023-11-15 14:41 What do you mean careful? I'm not a python dev, but everything is indented just the same. I'm missing why anyone would not choose good indentation that matches the python requirements. ---------------------------------------------------------------------- lilolalu · 2023-11-15 15:15 I just installed JupyterLab and ventured into the world of data visualization in Python, letting ChatGPT do the dirty work. I love that it not only corrects the grammar and spelling it can fix your indentation errors in toml and yaml (or python) as well and give you an individual lesson on what you did wrong and why (if you want that.) ---------------------------------------------------------------------- ava1ar · 2023-11-15 15:22 Agree, but wrong indentation should not break the logic of your code! ---------------------------------------------------------------------- kmisterk · 2023-11-17 18:11 ## Post Removed Hey, RapidScampi! Thanks for your submission on selfhosted. Your post has been removed due to a violation of the purpose of the subreddit: **Self Hosting** ## Not Self-Hosted When it comes to posts regarding applications in this subreddit, they must feature a self-hosted tool, or a tool that *can be* self-hosted, or some kind of related information, help request, or otherwise related to a tool that is something that one can self-host. If you believe this post *is in fact* relevant to /r/selfhosted, feel free to [message the mods](https://www.reddit.com/message/compose/?to= /r/selfhosted&subject=Removed For Not Being Self- Hosted&message=[Removed Post](https://www.reddit.com/r/selfhosted/comments/17upcug/-/\)) with your concerns.