Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Default to string or dynamic values with no quotes? #787

Closed
thecyman opened this issue Nov 20, 2020 · 1 comment
Closed

Default to string or dynamic values with no quotes? #787

thecyman opened this issue Nov 20, 2020 · 1 comment

Comments

@thecyman
Copy link

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.

@thecyman thecyman changed the title Default to string values with no quotes? Default to string or dynamic values with no quotes? Nov 20, 2020
@pradyunsg
Copy link
Member

Thanks for filing this issue!

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.

As for dynamic types, please see #603.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants