4 ms·
Toml is far superior for hand editing. This is why yaml is terrible (aside from significant white space): foo: 80:80 bar: 22:22 baz: 22.22 What's
by NateDad 9y ago
Toml is far superior for hand editing. This is why yaml is terrible (aside from significant white space):
foo: 80:80
bar: 22:22
baz: 22.22
What's the value of foo? It's the string "80:80". What's the value of baz? The float 22.22 What's the value of bar? The integer 1342.
I rest my case about both readability and writability.
- thanksgiving 9y ago> bar: 22:22 I know zero toml (don't even know what toml stands for) but I'm pretty sure you meant the value of bar is the string 22:22 based on foo.
- falcolas 9y agoI think he's attempting to point out a shortcoming of yaml; I can reproduce it myself in Python. That said, I've never run up against this myself - in the face of potential ambiguity I attempt to be explicit, and surround it in quotes to be explicit string. TOML itself is going through its own growth pains brought on by a rather sizable spec. For example: >>> pytoml.loads("foo = 20:20:20") [...] pytoml.core.TomlError: <string>(1, 9): msg
- callumlocke 9y agoI agree that's a downside, but it almost never comes up in practice, and it's solved by syntax highlighting when it does. I'm always in a code editor when editing YAML, it's not something that goes down the wire and needs to be debugged without syntax colours. For config files it's fine. Maybe TOML is even better, I haven't used it. I'm just saying these problems raised about YAML have never really affected me and I use it all the time. For config only. JSON for data exchange.