3 ms·
I don't think this is to do with catching errors. You can throw errors at load time with both mechanisms if that's what you want. Instead, the question is, sho
by kybernetikos 3y ago
I don't think this is to do with catching errors. You can throw errors at load time with both mechanisms if that's what you want. Instead, the question is, should the file format include a bunch of notation so that the computer can deserialize the value to some type even without knowing what it'll be used for?
Since ini is a format designed for humans to read and write, the argument is that no, the reading code should decide how to interpret the value, and this is fine because it knows whether it wants this particular value to be a boolean or a string or a number or a continent.
The ini file reader has an implicit schema in its reader code. The TOML file makes (some of) the types explicit in the file itself at the expense of making it less convenient for a human to read and write.
- naasking 3y agoFollowing this argument to its logical conclusion, why bother having any kind of standardized format at all, ini or otherwise? The program's config reader knows what it wants to read, why bother standardizing names, notation, section delimiters, or anything else?
- kybernetikos 3y agoI presume the argument the author of this article would make is because it helps the human writer of the file.
- naasking 3y agoAnd a standardized format takes that even further, since now text editors can be aware of more of the file structure and assist with highlighting, completion and more.
- kybernetikos 3y agoNestedText was mentioned earlier in this thread, and it takes the philosophy to it's logical conclusion. That conclusion includes schemas https://nestedtext.org/en/latest/schemas.html https://nestedtext.org/en/latest/schemas.html. Text editors could absolutely be written to understand schemas and provide the help you suggest.
- marcosdumay 3y ago> why bother having any kind of standardized format at all, ini or otherwise? So you can reuse the parsing code and the file-editing instructions. Standardization is not about catching errors.