You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Now this is controversial but it's an important discussion.
What about allowing: MyVariable=Hello, world
Where, if there are no quotes, it interprets it as a string or dynamic by default.
This may seem controversial, but hear me out: Text files are a human interface.
Most computer users- gamers, IT staff, graphic designers, Excel pros, tinkerers, chemists, 3D animators, bloggers, tech support staff, students.. will edit text-based configuration files.
These groups are not programmers. Some know a little, other do not. I do not think forcing them to use quotes is necessary in some cases.
We as programmers need to check our inputs and make their life easy. Not the other way around.
If it's a Python pip configuration file, then yes, no ambiguities makes sense... But, if it's game configuration file or Excel plug-in, I may not want to force users to see quotes nor use quotes in config files.
Example- For a CMS project I'm involved with- you really feel the push for dead simple text files. Even amateur actors use it to maintain their own website.
Worth noting- text files as a "configuration interface" are not going anywhere. In a long forgotten age, people theorized we might make everything into a GUI. But increasingly non-programmers are going back to text configurations- Ubuntu, WordPress, command line tools, etc.
One approach could be for libraries to optionally accept values as "dynamic" types like C#, allowing programmers to parse them as they please.
The text was updated successfully, but these errors were encountered:
thecyman
changed the title
Default to string values with no quotes?
Default to string or dynamic values with no quotes?
Nov 20, 2020
This is an intentional design choice to ensure that values are unambiguous (1 as a string vs 1 as an int). And, trying to be smart and detecting what the type of the value should be leads to the Norway/YAML style issues.
Now this is controversial but it's an important discussion.
What about allowing:
MyVariable=Hello, world
Where, if there are no quotes, it interprets it as a string or dynamic by default.
This may seem controversial, but hear me out:
Text files are a human interface.
Most computer users- gamers, IT staff, graphic designers, Excel pros, tinkerers, chemists, 3D animators, bloggers, tech support staff, students.. will edit text-based configuration files.
These groups are not programmers. Some know a little, other do not. I do not think forcing them to use quotes is necessary in some cases.
We as programmers need to check our inputs and make their life easy. Not the other way around.
If it's a Python pip configuration file, then yes, no ambiguities makes sense... But, if it's game configuration file or Excel plug-in, I may not want to force users to see quotes nor use quotes in config files.
Example- For a CMS project I'm involved with- you really feel the push for dead simple text files. Even amateur actors use it to maintain their own website.
Worth noting- text files as a "configuration interface" are not going anywhere. In a long forgotten age, people theorized we might make everything into a GUI. But increasingly non-programmers are going back to text configurations- Ubuntu, WordPress, command line tools, etc.
One approach could be for libraries to optionally accept values as "dynamic" types like C#, allowing programmers to parse them as they please.
The text was updated successfully, but these errors were encountered: