4 ms·
Thank you for your comment ! This issue consumed a lot of my brain thinking cycles, which is why Textual Paradict allows both of its modes (data and config) to
by alexrustic 3y ago
Thank you for your comment ! This issue consumed a lot of my brain thinking cycles, which is why Textual Paradict allows both of its modes (data and config) to be used in the same document or section:
[user]
name = 'John Doe'
'région': 'Himalaya'
> ASCII hurts readability, not helps, especially since a lot of regular text constructs that humans use to improve readability are excluded.
Characters like œ [1] or ï [2] are common in my everyday vocabulary, but I've always stuck to ASCII and underscore in my code sources for reasons like keyboard layout availability, portability, IT legacy, etc.
> Also it's strange that your view of the config users is so limited as to only include programmers
The Paradict texual format has two modes (data and config) for this very reason: we need a relaxed version of the data mode.
I will continue to weigh the cons and pros for the characters allowed in the config keys. At the moment, some of the pros are:
- Developer experience: the 'dictionary unpacking' [3][4][5] capability in programming languages is really cool.
- Target population: I assume that the majority of configfile users are programmers and those who are not are used to following more complicated rules (e.g. formulas in spreadsheets).
- Least astonishment principle: people already know by heart the rules for naming identifiers in C (which inspired many other languages).
- The "key = value" syntax is the same as the variable assignment syntax.
- With rendering ASCII as a monospaced font, we won't complain about a character being visually similar to a space or the equal sign (=).
[1] https://en.wikipedia.org/wiki/%C5%92 https://en.wikipedia.org/wiki/%C5%92
[2] https://en.wikipedia.org/wiki/%C3%8F https://en.wikipedia.org/wiki/%C3%8F
[3] https://reference.codeproject.com/python3/dictionaries/python-dictionary-unpack https://reference.codeproject.com/python3/dictionaries/pytho...
[4] https://discuss.python.org/t/syntax-for-dictionnary-unpacking-to-variables/18718 https://discuss.python.org/t/syntax-for-dictionnary-unpackin...
[5] https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...