3 ms·
Configuration files usually are only read by one piece of code. Besides, the article is correct in that the type system from TOML is completely inadequate for f
by marcosdumay 3y ago
Configuration files usually are only read by one piece of code. Besides, the article is correct in that the type system from TOML is completely inadequate for fully parsing the files anyway, so it will necessarily depend on implicit agreement on the semantics from every reader.
IMO, configuration file formats should only ever have text as primitive type. Anything else should be defined in another layer. I completely agree with that part of the argument from the article.
Then the article goes to argue that the quotes are harmful... And no, if you have a whitespace sensitive language, you need a damn good representation for strings that won't allow for ambiguity to creep in. And INI is just horrible on this.
- coldtea 3y ago>Configuration files usually are only read by one piece of code. Having a single source of truth and multiple services and scripts needing the same info means the same configuration file will get to be read by many pieces of code, even from different languages. And that's without considering piecemeal migration of the same "one piece of code" running on different services to another language or a version two design, still needing to read the same file. >IMO, configuration file formats should only ever have text as primitive type. Anything else should be defined in another layer. I completely agree with that part of the argument from the article. I mean, that's not even wrong. Except if you mean "they should not be binary". Then, sure.
- AndyKluger 3y ago> IMO, configuration file formats should only ever have text as primitive type. Anything else should be defined in another layer. I very much agree. If you haven't checked it out, NestedText is an excellent format that takes this sentiment to heart.