4 ms·
Personally I'm partial to the classic Windows-style INI file. Because it was designed to be a human-editable configuration file format, it has a simple and int
by TazeTSchnitzel 8y ago
Personally I'm partial to the classic Windows-style INI file.
Because it was designed to be a human-editable configuration file format, it has a simple and intuitive format that is easy for both humans and machines:
[Section]
; comment
Key1=Value
; comment
Key2=Value
[Section2]
Key1=Value
It is also easy for machines to non-destructively edit, maintaining existing comments and formatting by humans, and applications take advantage of that. That is a big plus in my opinion.
- Pxtl 8y agoThe problem with ini is that it has no good story for arrays or associative arrays. TOML attempts to fix this, but it provides ugly format for arrays and associative arrays.
- afiori 8y agoI personally find the TOML solution quite nice. In part because you can always drop to JSON syntax to avoid excessive nesting of array tables.
- cheerlessbog 8y agoTOML is arguably an evolution of ini format.
- tinus_hn 8y agoIt is pretty limited and the worst part is quoting. What if your value contains \n? What about UTF8?
- BuckRogers 8y agoI agree, but my second choice if INI doesn't suit someone is just the standard app.config in Windows (trivial to interface with in the .Net space), or storing the values in a table. I'd prefer any of these before JSON or the other alternatives.
- robocat 8y agoHorrible for: UTF8, syntax checks, numbers (albeit JSON has this problem too for floats), deep nesting, arrays, strings as keys, consistency between different parsers, etc etc Good for: comments, readability if keys limited, familiarity.
- TazeTSchnitzel 8y agoUTF-8 is only a problem if you're using the Windows implementation. I don't see what the problem with numbers is, either, pick a representation that suits you and use it.
- h1d 8y agoNo standard = deal breaker. Comments might work for a parser but not on another. What's the point when you can do better with TOML?