4 ms·
Agreed. I feel like everyone uses YAML, I hate it. YAML feels like 10 steps back; no parser I've ever used has been able to accurately give me a line number fo
by alias_neo 8y ago
Agreed. I feel like everyone uses YAML, I hate it.
YAML feels like 10 steps back; no parser I've ever used has been able to accurately give me a line number for an error, white space issues make it impossible to work with without special editor features, and some of the types are just cryptic. I spend most of my time that's spent editing configs in vim over SSH and it can be challenging at times.
TOML resolves a lot of these issues in my experience but I'd still argue that by virtue of its capability, is still quite complex when trying to define configs for new applications.
- rgacote 8y agoAnd TOML does not have the security code execution vulnerability that is in YAML.
- StavrosK 8y agoI once tried to use YAML as my format of choice. Then I read the spec. YAML: Not even once.
- h1d 8y ago> TOML resolves a lot of these issues The only complaint is that the name TOML isn't as cool as other formats.
- justinclift 8y agoCame across a pain point with TOML yesterday in use. When trying out a CLI I've been writing recently, this time on Windows... the TOML config file (generated on first run) wasn't usable. The problem turned out to be TOML not handling single slashes "\" in strings, instead treating them as escape characters. Annoying as on Windows the paths are (eg): "C:\Program Files\stuff". Which then needs changing to "C:\\Program Files\\stuff" to work ok. I can see both good and bad points of TOML's string handling there. But it's annoying it needs a workaround for one of the signature aspects (slash vs backslash) of windows. Especially when paths are very common in config files, regardless of OS. :/
- frosted-flakes 8y agoJust use 'literal strings' instead of "basic strings". TOML has two types of strings, each of which can be single line or multi line [0]. Basic strings allow escape characters, while literal strings do not (so there's no way to represent an apostrophe in a single line literal string). Multi line strings are like Markdown's code blocks: """ This is a multi- line basic string. C:\\Program Files\\stuff """ ''' This is a multi- line literal string. C:\Program Files\stuff ''' [0] https://github.com/toml-lang/toml/blob/master/README.md#string https://github.com/toml-lang/toml/blob/master/README.md#stri...
- justinclift 8y agoThanks heaps, that looks like exactly the right solution. :)